PDA

View Full Version : where-condition in Stats



MrQNo
05-25-2009, 11:21 AM
Hi,

I'm trying to customize some stats. At this moment, i'm looking at two problems:

1. I want to calculate the sum of the rake of the hands that i have won ("paid" rake, opposed to the standard dealt rake).

2. I want to calculate the rakeback at different platforms without using a filter. If i use the well known 27%Rakeback-Formula, all hands played at Stars or Everest are calculated. But there is no rakeback, so the value is wrong.

What both cases have in common is that i have a known "standard" calculation, and i want to consider only a defined part of those hands (in 1. it's the won hands, in 2. it's the hands on a specific platform). In SQL i could formulate a where expression. How is it done for HM custom stats?

TheZepper
05-26-2009, 04:07 PM
First, read FAQ on customizing stats which uses RB as an example. So, starting with standard RB stat:

<Stat GroupName="Default" ColumnName="Rakeback" ValueExpressions="Sum(PH.RakeAmount)/100.0*0.27 as RakeBackAmount" Evaluate="RakeBackAmount" ColumnHeader="Rakeback" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Rakeback based on 27%" />

The "where" expression equivalent (if ... then) is (case when .... then .... else) so to calc sum of RB of hands u won Stat Should be:

<Stat GroupName="Default" ColumnName="RakeBack27%" ValueExpressions="Sum(case when ph.netamountwon > 0 then ph.RakeAmount else 0 end)/100.0 as RakeAmountHandsWon" Evaluate="RakeAmountHandsWon*0.27" ColumnHeader="Rakeback\nHandsWon\b 27%" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="RakeBack Hands Won at 27% />

You can change rake % for each site by making separate Stats.

Hope this helps.

TheZepper
05-26-2009, 04:24 PM
For some reason, the stats don't seem to have been copied correctly - I'll try again.

<Stat GroupName="Default" ColumnName="Rake $" ValueExpressions="Sum(ph.RakeAmount)/100.0*0.27 as RakeAmount" Evaluate="RakeAmount" ColumnHeader="Rake" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Rake Paid" />

<Stat GroupName="Default" ColumnName="RakeBack HandsWon 27%" ValueExpressions="Sum(case when ph.netamountwon > 0 then ph.RakeAmount else 0 end)/100.0 as RakeAmountHandsWon" Evaluate="RakeAmountHandsWon*0.27" ColumnHeader="Rakeback\nHandsWon\b 27%" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="RakeBack Hands Won at 27% />

TheZepper
05-26-2009, 04:26 PM
Never had this problem before, so I'll try one last time.
<Stat GroupName="Default" ColumnName="RakeBack HandsWon 27%" ValueExpressions="Sum(case when ph.netamountwon > 0 then ph.RakeAmount else 0 end)/100.0 as RakeAmountHandsWon" Evaluate="RakeAmountHandsWon*0.27" ColumnHeader="Rakeback\nHandsWon\b 27%" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="RakeBack Hands Won at 27% />

TheZepper
05-26-2009, 04:28 PM
I'll send u PM.