Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
d_koti24
Creator II
Creator II

sum({1<year={2013}>}sales)

my data consists 4 years like 2010,2011,2012,2013

in set analysis how can   i use max(year) instead of year={2013}.....

i am using this below expr

sum({1<Year={(=max(Year))}>sales)

i am getting error.......how can resolve this ?

1 Solution

Accepted Solutions
Anonymous
Not applicable

... or

sum({1<Year={"$(=max({1} Year))"}>} sales)

If you want max year to be independent from selections

View solution in original post

8 Replies
MK_QSL
MVP
MVP

SUM({<Year = {'$(=Max(Year))'}>}sales)

or

SUM({1<Year = {'$(=Max(Year))'}>}sales)

its_anandrjs

Try with

sum({< Year = {'$(=Max(Year))'} >} sales)

Anonymous
Not applicable

... or

sum({1<Year={"$(=max({1} Year))"}>} sales)

If you want max year to be independent from selections

d_koti24
Creator II
Creator II
Author

my reqiurement is i want to get

2013,and 2012 or 2011 or 2010(current selection) total sales.....

i want to compare the sales with  2013....

i am using this expr (sum({1<year={2013}>}sales)) i am getting correct o/p..instead of this expr using

SUM({1<Year = {'$(=Max(Year))'}>}sales) this , iam getting all 4 yrs total in 2013 field....

MK_QSL
MVP
MVP

SUM({<Year *= {'$(=Max({1}Year))'}>}sales)


or


=SUM({<Year = {'$(=Max(Year))','2013'}>}Sales)

its_anandrjs

Try with this way

sum({< Year = {'$(=Max(Year))', '$(=Max(Year)-1)'} >} sales)

Or

sum({< Year = {"$(=Max(Year))", "$(=Max(Year)-1)"} >} sales)

If you want max and last max years like 2013 and 2012

Anonymous
Not applicable

Try with this:

SUM({<Year={'$(=Date(max(Year),'YYYY')'}>}sales)

d_koti24
Creator II
Creator II
Author

thank u