Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis use value of another expression

Hello,

I have a table looking like this:

AccountNoFormulaAmount
1">=100000<=199999"To be calculated (700)
100000100
110000100
120000500
2">=200000<=299999"To be calculated (550)
200000200
200009300
21000050

I want to calculate the amount for headers 1 and 2 using set analysis. I've made the expression 'Formula' which contains a formula I can use to filter the correct account numbers for the total.

If I use      Sum({$<AccountNo = {">=100000<=199999"}>}TOTAL Amount)      I get a correct result for AccountNo 1. But then I have to make a formula for every total account there is..

Is there any way I could use the value of another expression in a set analysis formula to calculate another expression?

I have tried things like Sum({$<AccountNo = Formula>}TOTAL Amount) but that didn't work.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can't use set analysis expressions here since you want different sets for different rows. You'll have to create accountgroups in some way. Attached is an example that with three different ways. Look at the calculated dimensions to see how the groups are created. You could also create the groups in the script.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Anonymous
Not applicable
Author

hi did u try

Sum({1<AccountNo = {">=100000<=199999"}>}TOTAL Amount)  

Gysbert_Wassenaar

You can't use set analysis expressions here since you want different sets for different rows. You'll have to create accountgroups in some way. Attached is an example that with three different ways. Look at the calculated dimensions to see how the groups are created. You could also create the groups in the script.


talk is cheap, supply exceeds demand
Not applicable
Author

Thx for your reply,

I don't want to use ">=100000<=199999" in my set analysis, I want to use the expression 'Formula' somehow