Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

help in expression

hello

got a bar chart with dimension MonthYear (e.g. Jan-2014, Feb-2014)

the expression is sum(Sales)

ok I select the year 2014

and I get sales for the following months Jan, Feb, April

what I want now is get the last month that has sales in the above chart

how can I get the value of Apr-2014 from the sum(sales)

I can walk on water when it freezes
1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II
Author

max(MonthYear) gives Dec-2014 and this is not the case

i found this maxString({<MonthYear={"=sum(Sales)>0"}>}Sales)

I can walk on water when it freezes

View solution in original post

4 Replies
Not applicable

Please try this:

sum({1<MonthYear ={$(=max(MonthYear ))} Sales)

ali_hijazi
Partner - Master II
Partner - Master II
Author

I was thinking of using firstsortedvalue

but could not get any result

I can walk on water when it freezes
simenkg
Specialist
Specialist

sum({<MonthYear ={"$(=max(MonthYear ))"} Sales)


This will give you sales in the last possible MonthYear in the selection.




ali_hijazi
Partner - Master II
Partner - Master II
Author

max(MonthYear) gives Dec-2014 and this is not the case

i found this maxString({<MonthYear={"=sum(Sales)>0"}>}Sales)

I can walk on water when it freezes