Thanks for the reply.
I wanted a nested IF so I could put one rate on the dates before Feb 1 and one rate on the dates after. So given the last quoted expression, I would have to re-include the Crake calculation. Something like this:
sum(if[cash_hand_player_statistics.amt_bet_ttl > 0 AND cash_hand_summary.amt_rake > 0 AND cash_hand_player_statistics.date_played < '2013-02-02 00:00:00', cash_hand_summary.amt_rake * (cash_hand_player_statistics.amt_bet_ttl / cash_hand_summary.amt_pot) * .35, if[cash_hand_player_statistics.amt_bet_ttl > 0 AND cash_hand_summary.amt_rake > 0 , cash_hand_summary.amt_rake * (cash_hand_player_statistics.amt_bet_ttl / cash_hand_summary.amt_pot) * .14,0]])
That doesn't work though. Seems the nested IF breaks it.
What I have ended up doing is just making a series of columns for whatever date ranges I have with different RB/Reward amounts. Something like:
Column1 -
sum(if[cash_hand_player_statistics.amt_bet_ttl > 0 AND cash_hand_summary.amt_rake > 0 AND cash_hand_player_statistics.date_played < '2013-02-02 00:00:00', cash_hand_summary.amt_rake * (cash_hand_player_statistics.amt_bet_ttl / cash_hand_summary.amt_pot) * .35, 0])
Column2 -
sum(if[cash_hand_player_statistics.amt_bet_ttl > 0 AND cash_hand_summary.amt_rake > 0 AND cash_hand_player_statistics.date_played >= '2013-02-02 00:00:00', cash_hand_summary.amt_rake * (cash_hand_player_statistics.amt_bet_ttl / cash_hand_summary.amt_pot) * .35, 0])
Then I have a stat that just includes both. One or the other is always set to 0, so the calculation works over whatever date range I choose.
RBStat -
Column1+Column2
This is giving me the results I need and I will just have to create a new column and redo the Crake calc every time I need to add a date range.
I still wish I could figure out how to do this without having to manually offset my date by one. Any insight why the datefix functions throw an error when used in an IF statement in a column?