Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
TEST_INLINE:
LOAD * INLINE [
TOGGLE
M,
W
];
TAB:
LOAD * INLINE [
FLAG, DATE, VALUE, MONTH_YEAR
MONTHLY, 2022-01-01, 0, 202201
MONTHLY, 2022-02-01, 0, 202202
MONTHLY, 2022-03-01, 0, 202203
MONTHLY, 2022-04-01, 3000, 202204
MONTHLY, 2022-05-01, 4000, 202205
MONTHLY, 2022-06-01, 500, 202206
MONTHLY, 2022-07-01, 4200, 202207
MONTHLY, 2022-08-01, 6030, 202208
WEEKLY, 2022-01-01, 2000, 202201
WEEKLY, 2022-02-01, 2400, 202202
WEEKLY, 2022-03-01, 2200, 202203
WEEKLY, 2022-04-01, 2030, 202204
WEEKLY, 2022-05-01, 2000, 202205
WEEKLY, 2022-06-01, 6000, 202206
WEEKLY, 2022-07-01, 4200, 202207
WEEKLY, 2022-08-01, 6030, 202208
];
IF(GetFieldSelections(TOGGLE)='M',
Sum({<FLAG ={'MONTHLY'},MONTH_YEAR={">$(=MAX(MONTH_YEAR)-2)"}>}VALUE))
The expression is not filtering to only 2 month_year rather it is showing all the month_year with 0 values.
When I am not using If condition that time it is filtering properly.
This is behaving as I'd expect - with the If() statement, this is evaluated for every dimension value because the if() doesn't contain set analysis excluding any values. You could uncheck "Include zero values" to get around this, or re-write the formula:
Sum({<FLAG ={'MONTHLY'},MONTH_YEAR={">$(=MAX(MONTH_YEAR)-2)"}>}
IF(GetFieldSelections(TOGGLE)='M',VALUE))
This is behaving as I'd expect - with the If() statement, this is evaluated for every dimension value because the if() doesn't contain set analysis excluding any values. You could uncheck "Include zero values" to get around this, or re-write the formula:
Sum({<FLAG ={'MONTHLY'},MONTH_YEAR={">$(=MAX(MONTH_YEAR)-2)"}>}
IF(GetFieldSelections(TOGGLE)='M',VALUE))