Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Billy_u
Creator
Creator

VARIABLE IN SET ANALYSIS

Hi everyone,

i try in qlik sense a set analysis with a variable, i will want calcolate a misure of year and year preview, but make me the total:

 

sum({<ANNO = {$(=max(ANNO))}},=$(=$(varaiblemesaure)))

 

With this result a total of all year...

 

thx every one,

hi,

Billy

Labels (2)
9 Replies
Anil_Babu_Samineni

What is the "varaiblemesaure"?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Billy_u
Creator
Creator
Author

is a variable / container, where there is an expression whose result is a score

Anil_Babu_Samineni

If that variable returns 1000, Simply use 

sum({<ANNO = {"$(=max(ANNO))"}>} variablename)

Or

sum({<ANNO = {"$(=max(ANNO))"}>} $(variablename))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Billy_u
Creator
Creator
Author

the problem is that it makes me the total sum, instead I would like the data of the year max or of the previous year, to compare them

Anil_Babu_Samineni

The same question you already asked in the opening message itself. What is variable you defined? Is this something ANNO = {"$(=max(ANNO))"} calculating the Max Year? If not, What your goal here?

If you need compare analysis, Create Bar chart with Dimension as ANNO and Expression

Sum({<ANNO = {">=$(=AddYears(Max(ANNO),-1))<=$(=Max(ANNO))"}>} variablename) 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Billy_u
Creator
Creator
Author

I would like to make the difference between the (variable) score of the current and previous year variable

Anil_Babu_Samineni

Can u please upload an example to test?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Billy_u
Creator
Creator
Author

the result if i will want it's:

something similar...

($(score(MaxYear)) - $(score(MaxYear-1))) / $(score(MaxYear-1))

Anil_Babu_Samineni

Seems like this is like Parameter query in analysis? I believe you already have variable like score in that you want by pass the all values with Latest and Latest-1? 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful