Page 1 of 2

Aaaarrrrggghhh

PostPosted: Thu Sep 03, 2009 8:13 am
by phonix4
I've jst managed to get my custom report to work with the date filter so that i only see the players playing from a specified date. this is so i can quickly see certain stats about my current opponents rather than have to trawl through the lists to search each player individual.
This is working fine so i only see the players that have played since the date selected. The only problem with this is all of the stats in my report now only provide the stats for the date specified.
So.
How can i view the players that i have played since Say yesterday but view their all time stats rather than jst the stats since yesterday?????????????????
In otherwords is there a way to run the date stat on the player stat only in my report rather than all columns so i get the current players but the rest of the report runs for all time stats rather than also being run through the date stat.

Re: Aaaarrrrggghhh

PostPosted: Thu Sep 03, 2009 9:09 am
by kraada
LIkely you'll just need to change your filter definition.

What are you currently using?

Re: Aaaarrrrggghhh

PostPosted: Mon Sep 07, 2009 12:15 pm
by kraada
I answered your question via PM but just to put things on the record for everyone else, I thought I'd post here.

phonix4 was looking for a custom report that showed only players that have hands imported from them today, but he wanted the report to show their lifetime statistics.

So you won't be able to filter using the regular Simple Filters on the custom report tab as that will show you only data from today - so you wouldn't have lifetime statistics.

Instead, you need to create a custom report and add this as a filter:
player.id_player IN (SELECT p.id_player FROM player p, holdem_hand_player_statistics hhps WHERE p.id_player = hhps.id_player AND hhps.date_played::date = localtimestamp::date)

What's going on here? We're filter for times the id_player (that is, the unique identifier associated with each player) is in a certain list. This will limit players to a certain group but won't limit hands later. What are we looking for id_player to be in? We built it as a subquery:
SELECT p.id_player FROM player p, holdem_hand_player_statistics hhps WHERE p.id_player = hhps.id_player AND hhps.date_played::date = localtimestamp::date

So anytime the player ID matches one of the p.id_player values, we see data for that player. We also need the holdem_hand_player_statistics table as that table is the one we are going to use to see if the player played any hands today. So we also select from a holdem_hand_player_statistics table (called hhps). We make sure that the player_ids match (p.id_player = hhps.id_player) because we want data from the same player. Then we make one more check:

hhps.date_played::date = localtimestamp::date

This is checking that the date_played field in the hhps table when turned into a date (e.g. 9/5/2009) matches the localtimestamp when turned into a date. localtimestamp is a reserved local variable that is always available in PostgreSQL and it always returns the current time right now. So when we cast it as a date, it will return today's date.

Putting everything back together, the subquery pulls out the id_player values for players who played today, and the whole query tests for whether someone's player ID is in that list. If it is, we display them. If it isn't, we don't.

I've attached this report (and uploaded it to the repository) and have the current version just display a player's name and the number of hands we have on the player. You can of course add any other data you would like to see.

Re: Aaaarrrrggghhh

PostPosted: Wed Sep 09, 2009 11:45 am
by phonix4
Hi. I've downloaded the file but i can't import it into my reports. it doesn't show up for import. Also i've tried to open the file but my computer doesn't recognise the extension.

What should i do????

Also I've recreated the summary report in my custom reports can i jst add the filter to that????

Re: Aaaarrrrggghhh

PostPosted: Wed Sep 09, 2009 12:05 pm
by WhiteRider
You need to extract the report file from the .zip before importing it.
Right click > Extract.

Re: Aaaarrrrggghhh

PostPosted: Sat Mar 20, 2010 3:27 pm
by jimmyfloyd
Kraada,

Does this file work for the Mac version?

Thanks.

Re: Aaaarrrrggghhh

PostPosted: Sat Mar 20, 2010 4:25 pm
by WhiteRider
Yes - all files are cross-platform.

Re: Aaaarrrrggghhh

PostPosted: Fri Apr 08, 2011 10:38 pm
by domakeufeelrandy
Quick question. If i wanted to make this report for omaha, how would I do so?

I'm assuming I would have to change holdem_hand_player_statistics to omaha_hand_player_statistics, however when I do so my report is blank yet it tells me my expression is valid.

Any thoughts? thanks

Re: Aaaarrrrggghhh

PostPosted: Sat Apr 09, 2011 4:28 am
by WhiteRider
Did you remember to untick "Filter on Active Player"? in the report Filter window?
Did you create your report in the Omaha Cash Player Statistics section?
That filter with the change you mention is working for me.

Re: Aaaarrrrggghhh

PostPosted: Sat Apr 09, 2011 5:26 am
by domakeufeelrandy
Yes, I copied the expression in the Hold'em Report into a new report under Omaha Cash Player Statistics. I only changed the part where it said holdem so the "new" expression I have is this:

player.id_player IN (SELECT p.id_player FROM player p, omaha_hand_player_statistics hhps WHERE p.id_player = hhps.id_player AND hhps.date_played::date = localtimestamp::date)

The "Filter on Active Player" is unticked but my report signals 0 players. Where did I screw up?

highfalutin