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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
hargovind_singh
Partner - Contributor II
Partner - Contributor II

set expression

Hi All,

I am stuck with set expression in qliksense.

I am getting correct values for 2020 in

sum({<Fin_Period={'$(=upper(SUBFIELD(parameter_code,':', -1)))$(=right(year(today())-1,2))'},Schedule_Type-={'ACC'}>}Amount_Millions)

 

bt when i am using this,

=sum({$<Fin_Period={'$(=UPPER(SUBFIELD(parameter_code,':', -1)))$(=right(GetFieldSelections(Year1)-1,2))'},Schedule_Type-={'ACC'}>}Amount_Millions)

 

I am getting 0.000 thats not a correct value.

so could someone pls help me .

Thanks 

9 Replies
agigliotti
MVP
MVP

Hi @hargovind_singh 

what do you get with the below expressions?

right(GetFieldSelections(Year1)-1,2)
right(year(today())-1,2)

do they match?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
hargovind_singh
Partner - Contributor II
Partner - Contributor II
Author

Yes they match, like

right(GetFieldSelections(Year1)-1,2) giving whatever election i m making let say 2021 then it will give right(2021-1,2) => 19

and right(year(today())-1,2) also giving same as 19

 

hargovind_singh
Partner - Contributor II
Partner - Contributor II
Author

But still its not working what can be a possible solution?

agigliotti
MVP
MVP

what do you get for the below expressions?

=UPPER(SUBFIELD(parameter_code,':', -1))
=right(GetFieldSelections(Year1)-1,2)

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
hargovind_singh
Partner - Contributor II
Partner - Contributor II
Author

UPPER(SUBFIELD(parameter_code,':', -1)) gives like JAN, FEB,MAR etc....

right(GetFieldSelections(Year1)-1,2) gives like 20,19,18 etc....

based on selections in filters Year1 and parameter_code

 

agigliotti
MVP
MVP

how does "Fin_Period" field looks like?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
hargovind_singh
Partner - Contributor II
Partner - Contributor II
Author

like Jan, Feb,Mar 

agigliotti
MVP
MVP

I can't understand , could you share a sample app with mock data to look at?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
hargovind_singh
Partner - Contributor II
Partner - Contributor II
Author

sum({<Fin_Period={'$(=upper(SUBFIELD(parameter_code,':', -1)))$(=right(year(today())-1,2))'},Schedule_Type-={'ACC'}>}Amount_Millions)

  and 

sum({<Fin_Period={'$(=upper(SUBFIELD(parameter_code,':', -1)))$(=right(GetFieldSelections(Year1)-1,2))'},Schedule_Type-={'ACC'}>}Amount_Millions)

in console both are giving same value like this in attached image,