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: 
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
Partner - Champion
Partner - Champion

Hi @hargovind_singh 

what do you get with the below expressions?

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

do they match?

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
Partner - Champion
Partner - Champion

what do you get for the below expressions?

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

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
Partner - Champion
Partner - Champion

how does "Fin_Period" field looks like?

hargovind_singh
Partner - Contributor II
Partner - Contributor II
Author

like Jan, Feb,Mar 

agigliotti
Partner - Champion
Partner - Champion

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

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,