Total MGR

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

Total MGR

Postby Henry17 » Sat Jan 02, 2010 1:37 pm

I'm working on a new stat but I'm fairly new to this.

I need to be able to get Total MGR for all limits rather than just for a particular limit so that I can use that number as an expression in a conditional statement.

Is this possible?

If yes how?
Henry17
 
Posts: 7
Joined: Thu Apr 03, 2008 1:21 pm

Re: Total MGR

Postby kraada » Sat Jan 02, 2010 1:46 pm

This already exists as MGR in the Holdem Tournament Sessions section; you just need to add it to a report that doesn't break the report down by row and you'll see total MGR (you'll also see it at the bottom of a report that uses this stat).

What are you trying to build? If you give me some more information I'd be glad to help you figure out where to go next.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Total MGR

Postby Henry17 » Sat Jan 02, 2010 2:00 pm

I'm trying to build a real time stat for the Stars loyalty program that includes the milestones.

The way I'm going this is by having the cash value of every FPP change at a given milestone. I was able to do this quite easily by just creating a number of stats each with a different cash value per FPP that I manually enter. This works fine but lack elegance as it requires that the user remove the 300k-399k stat and then add the 400-499k stat.

What I want to be able to do is create a Cash Value column that chooses a value for FFPs based on Total MGR (basically just a really big nested IF statement) and that way I can get rid of the multiple versions of the stat and instead just have one where the currently manually entered number is instead a variable.
Henry17
 
Posts: 7
Joined: Thu Apr 03, 2008 1:21 pm

Re: Total MGR

Postby kraada » Sat Jan 02, 2010 2:33 pm

You're building this stat in the Holdem Cash Player Statistics section, yes?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Total MGR

Postby Henry17 » Sat Jan 02, 2010 3:02 pm

Yes

I currently have it such that It calculates the number of FPPs earned and multiplies them by 0.016 to get you an amount earned as part of the program.

What I want to do is replace 0.016 with a variable.

So basically create a FPP Value column where If [Total_MGR < 16666 , 0.016 , If [Total_MGR < 33333 , 0.01943, If [ Total_MGR < 99999, ......

This would then allow me to change the stat to read FPP * FPP Value rather than FPP * 0.016
Henry17
 
Posts: 7
Joined: Thu Apr 03, 2008 1:21 pm

Re: Total MGR

Postby kraada » Sat Jan 02, 2010 3:28 pm

The way I can think to do this is actually by using the format tab on the Statistic itself.

You can use if statements there, and multiply there as well.

For example, assuming you built your FPP column as "amt_fpp", and MGR column as "amt_mgr" you could build your FPP Value stat with a format tab like:

if( amt_mgr < 16666 , format_number((amt_fpp * .16) , 2 , false , false)) , if( amt_mgr < 3333, format_number(amt_fpp * .01943), 2, false, false)) , if( amt_mgr < 99999 , ...

Just remember to close all of your )s for the if() statements at the end :)
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Total MGR

Postby Henry17 » Sat Jan 02, 2010 3:47 pm

The problem with that is that amt_mgr seems to return the MGR earned at each level. I need the total MGR for all play.

amt_mgr sum(holdem_hand_summary.amt_mgr) returns a different value for each level.

I'm looking for a query that returns the sum of all the MGR at every level of play.
Henry17
 
Posts: 7
Joined: Thu Apr 03, 2008 1:21 pm

Re: Total MGR

Postby kraada » Sat Jan 02, 2010 4:44 pm

sum(holdem_hand_summary.amt_mgr) will return the total amount of MGR.

If you're using a report, though, which has multiple limits, everything will get broken down by those rows. What's happening in that sort of report (e.g. the player statistics report on the general tab), is that PostgreSQL is grouping by a certain value (in that case, the stake you're playing). All stats displayed in that report will be broken down that way and there's no way to change that - it's just the way the SQL works.

If you build the stat as I explained it above, you can use it in a report that isn't broken down into multiple rows (though you may need to do it as a custom report) to get the values you want to see.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Total MGR

Postby Henry17 » Sat Jan 02, 2010 7:58 pm

I got it to work fine as a report. Thanks.

I was originally hoping to have it in the General Tab but I guess that isn't possible.
Henry17
 
Posts: 7
Joined: Thu Apr 03, 2008 1:21 pm


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

Who is online

Users browsing this forum: No registered users and 1 guest