Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis Query

Hi All,

I have an expression written in if condition would like to change it to set analysis..Here are those expressions..

If condition :  sum(Flag_ID*if(Year =  {'$(vMaxYear)'} Sales)

Set analysis : sum(Flag*_ID* sum({< Year= {'$(VMaxYear)}>} Sales ) )

The set analysis is not working.. can some one tell me what is going wrong in this...

Thanks in advnace....

17 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check the expression in the variable for vMaxYear.

     =Sum({< Year= {$(vMaxYear)},Flag_ID={1}>} Sales)

if its perfect this should work.

Celambarasan

Not applicable
Author

Fine thanks for the reply..

Can u plz tell me whether the below two expressions would give the same result ot not..

1.sum(total <[Class]> if year= vmaxyear,Sales)

2.sum({< Class=,Year = {'$(VMaxYear)'} >} Sales)

The Vmaxyear is a variable which calculates the Max year i.e Max(Total Date)

Thanks

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     2nd one will work but you have not include Flag_ID there?

     Then VMaxYear Variable expression should Max(Year) only know?but you used Date field there.

Celambarasan

Not applicable
Author

Hi,

plz forget the expression that I have posted previously.. Both are different.. I just wanted to check with you teh way I have implemented the if COndition and the set analysis now is correct or not...

In IF condition I have given total (Class) , but in set analysis have mentioned the same in Class = , Would both of  this expressions will give the same result???

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     No because 2nd one excludes the selection in the field class but 1st one includes the selection.

Celambarasan

To make correction:sum({<Year = {'$(VMaxYear)'} >} Total <Class> Sales) this and the first one are same.

Not applicable
Author

Hi can u plz tell me how do I include the selection in set analysis.. Could u edit the expression written in set analysis and let me know it..

Thanks

Not applicable
Author

Thanka alot for ur time..

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     But still not arrived the solution of your problem.

Celambarasan