Hours played weekly

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Hours played weekly

Postby HarrysBread » Wed Apr 23, 2014 11:27 am

Hello,

I'm trying to create a report that displays the number of hands I play in cash games every week and the number of hours.
So far, what I have working is (in colums): month, nb hands, nb week, my c won, my c AI-adj.

I can't figure out how to show the number of hours that is played every week. I have tried using "Real Hours month" but as its name suggests it only displays the number of hours I've played in a month.

I know I can get the weekly number of hours played by changing the date filters but if I want to compare every week spanning several months then it would be quite tedious.

Can you help me make a stat that would show the number of hours played every week?

Image

Thanks!
HarrysBread
 
Posts: 5
Joined: Mon Dec 02, 2013 11:54 am

Re: Hours played weekly

Postby kraada » Wed Apr 23, 2014 12:04 pm

There isn't a stat that groups hours played by week, so you'd need to build this as a custom stat. You'd need to make a new variable similar to the monthly one but using date_played_year_week instead of date_played_month.
kraada
Moderator
 
Posts: 54435
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Hours played weekly

Postby HarrysBread » Wed Apr 23, 2014 12:25 pm

Ok,
So, I've duplicated "var_cnt_minutes_real_month" and called it "var_cnt_minutes_real_week".
I changed the content from "lookup_realminutes_month(id_player, date_played_month, date_played_year)" to "lookup_realminutes_month(id_player, date_played_year_week, date_played_year)"
Then, I've duplicated "Real Hours Month" and called it "Real Hours Week".

Image

But when I try to edit the report, the columns displays 0 and flashed in red the error message: "QE_token: cannot convert value to double"
HarrysBread
 
Posts: 5
Joined: Mon Dec 02, 2013 11:54 am

Re: Hours played weekly

Postby kraada » Wed Apr 23, 2014 1:20 pm

A little more digging indicates that you need to build date_played_week rather than use date_played_year_week.

Give date_played_week this value expression, then use it in your variable:

dateextract_week[ datefix_fromutc[ cash_hand_player_statistics.date_played ]]

date_played_year_week also includes the year which isn't expected by the lookup function.
kraada
Moderator
 
Posts: 54435
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Hours played weekly

Postby HarrysBread » Wed Apr 23, 2014 3:05 pm

Thanks for your help!
HarrysBread
 
Posts: 5
Joined: Mon Dec 02, 2013 11:54 am


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 1 guest

cron