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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set expression

Hi all,

i am using below set expression in straight table. It is not displaying any data why ?

=sum({<Year={$(=Only(Year)-1)}>} Sale)

Can anyone what is mistake in above expression ?

Thanks in advance

Regards

Venkat

3 Replies
Not applicable
Author

Venkat,

Probably there is no data for that year. Anyways what does this expression return Only(Year)-1?

If it returns null then try using Max Function.

Kiran

Not applicable
Author

Hi Kiran, first thanks to your response.

that returns null, so now i used the max function. Now it is working.

I tried below expression , it is not generating any value, and what is FirstSortedValue and why it is not generating any result ?

= Sum({<Year={$(=FirstSortedValue(Year))

Thanks in advance

Regards

Venkat

Not applicable
Author

= Sum({<Year={$(=FirstSortedValue(Year)) has only set analysis where is the field to be summed? Probably you are looking for

= Sum({<Year={"$(=FirstSortedValue(Year))"}>} Sale).

Besides is best to have computed expressions of set analysis to be within double quotes (").

Kiran.