where-condition in Stats
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    16

    Default where-condition in Stats

    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?

  2. #2
    Former HM Support
    Join Date
    Sep 2008
    Posts
    132

    Default

    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.
    Last edited by TheZepper; 05-26-2009 at 04:19 PM.

  3. #3
    Former HM Support
    Join Date
    Sep 2008
    Posts
    132

    Default

    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% />

  4. #4
    Former HM Support
    Join Date
    Sep 2008
    Posts
    132

    Default

    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% />

  5. #5
    Former HM Support
    Join Date
    Sep 2008
    Posts
    132

    Default

    I'll send u PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •