Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a straight table with month as the dimension and 4 separate expressions.
Simply, I need to calculate in a separate text box but is the Maximum value in any month across those 4 expressions.
Is there anyway to do that without a very lengthy if statement?
I know how to calculate the maximum in each expression column separately, I'm just looking for an easy way to pick out the highest value.
Regards
Haider
I think I have just done it in the following way.
I put each expression in a variable
LET v_A =MAX(AGGR(SUM(column1),Month));
LET v_B=MAX(AGGR(SUM(column2),Month));
LET v_C=MAX(AGGR(SUM(column3),Month));
LET v_D=MAX(AGGR(SUM(column4),Month));
Then used the following expression
IF(v_A > (v_B AND v_C AND v_D), v_A,
IF(v_B > (v_A AND v_C AND v_D), v_B,
IF(v_C > (v_A AND v_B AND v_D), v_C,
IF(v_D > (v_A AND v_B AND v_C), v_D
))))
Hi Haider,
Can you post a sample data with expected output.
Regards
ASHFAQ
I think I have just done it in the following way.
I put each expression in a variable
LET v_A =MAX(AGGR(SUM(column1),Month));
LET v_B=MAX(AGGR(SUM(column2),Month));
LET v_C=MAX(AGGR(SUM(column3),Month));
LET v_D=MAX(AGGR(SUM(column4),Month));
Then used the following expression
IF(v_A > (v_B AND v_C AND v_D), v_A,
IF(v_B > (v_A AND v_C AND v_D), v_B,
IF(v_C > (v_A AND v_B AND v_D), v_C,
IF(v_D > (v_A AND v_B AND v_C), v_D
))))