Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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

9 Replies
Highlighted

Re: VARIABLE IN SET ANALYSIS

What is the "varaiblemesaure"?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

Re: VARIABLE IN SET ANALYSIS

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

Highlighted

Re: VARIABLE IN SET ANALYSIS

If that variable returns 1000, Simply use 

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

Or

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

Re: VARIABLE IN SET ANALYSIS

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

Highlighted

Re: VARIABLE IN SET ANALYSIS

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) 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

Re: VARIABLE IN SET ANALYSIS

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

Highlighted

Re: VARIABLE IN SET ANALYSIS

Can u please upload an example to test?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

Re: VARIABLE IN SET ANALYSIS

the result if i will want it's:

something similar...

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

Highlighted

Re: VARIABLE IN SET ANALYSIS

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? 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)