I have this metric:
- The first value right above the "if" statement should be considered just for dates after September 1st;
- The second value right above the "else" statement should be considered just for old dates (before September 1st).
What happens is that when I put the "hour" attribute inside the report, the value above the "if" statement is considered even for old dates.
The left report uses the same metric but without the hour attribute:
Why this happen? Can I do something to bring the right values?
OBS: I also tried to use the "case" statement in place of the "if" but I get the same result.
You have to put the aggregation function (SUM in this case) around the CASE statement, not inside it. The reason is that you probably want to evaluate the condition on the fact table, not on the resulting aggregation function.