Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik experts,
I have a question regarding IntervalMatch. It is possible to calculate subtotals using IntervalMatch, as shown in the example:
Is there a way to specify in IntervalMatch that instead of addition, I want to multiply or divide certain rows? For example: (A*C)/D
IF possible keep the Frontend Simple with a single Sum.
Thank you for your assistance.
Phan
In general it should be possible to generate an appropriate data-structure within the script to keep the UI expressions as simple as possible and especially by the summing-task it's achievable. By multiplying/dividing it's more difficult but it should be possible, too.
I'm not sure if you really need to an interval-match or maybe an internal while-loop or similar to create the data-structure because there should be already an appropriate logic within the source-system in which the accounts are grouped.
To get all this within the origin dimensionality isn't easy but it's not necessary because you could add all logic within parallel dimensions. Here is a good explanation of how the logic works:
Use the below expression for A*C/D requirement.
if(DIM='E', (sum(total {<DIM={"A"}>}Num*Multiplier) * sum(total {<DIM={"C"}>}Num*Multiplier))/sum(total {<DIM={"D"}>}Num*Multiplier), SUM(Num*Multiplier))
Thank you for your response. I'm already familiar with this solution, but the dataset is much larger, and building a nested IF statement for 20-30 lines wouldn't be very readable. Therefore, I would prefer a solution in the script.
Thank you, @marcus_sommer . Maybe the post will help me further, and I'll follow it as soon as possible.