Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Guru,
Please advise whether any difference between two scenarios of IF use?
1. $(=IF(ConditionField='True',sum,max))(Measure1)
Expectation is only one calculation per chart
2. IF(ConditionField='True', sum(Measure1), max(Measure1))
Expectation is calculation per each row.
Could the first scenario work faster and calculates 'IF' only once per chart?
Or will it be calculated per each row anyway?
I think your example may be missing quotes around 'sum' and 'max'.
In any case, #1 should be faster. it will still calculate per row, but it will only calculate one aggregation -- sum or max.
#2 will always calculate both sum and max but only display one result.
-Rob
The first scenario will calculate only when there is a selection in any field.
The second scenario is as per expectation.
For faster calculation, you can use Set Analysis.
Thanks for reply Ujjwal but what do you mean "will calculate only when there is a selection in any field"?
In scenario1 when ConditionField meet 'True' value will it start to calculate per each row?
I suppose formula is checking by row in both cases doesn't matter what is selection is in ConditionField.
QlikView Performance Leaders could you help with this formula behavior?
marcus_sommer, gwassenaar, bbt, pcammaert, rwunderlich, colin_albert
Thank you for your time!
Does #1 actually return something? It looks invalid.
-Rob
In case when ConditionField equals 'True' the expression returns sum(Measure1)
It is working on practice.
I think your example may be missing quotes around 'sum' and 'max'.
In any case, #1 should be faster. it will still calculate per row, but it will only calculate one aggregation -- sum or max.
#2 will always calculate both sum and max but only display one result.
-Rob