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: 
Not applicable

Max date in data

Hi,

New to qlik sense, I have a dataset like the one below, where I need to summarize last month's sales.

My result should be Sales for last month-> March 2016 = $78

How can I do this in a set analysis?

I have tried sum ({< [Month Year] = {'$(=Max(Date))'} >}  [Sales])  but no luck.

 

  

CustomerMonth YearSales
A1/1/16$10
B1/1/16$11
C1/1/16$12
D1/1/16$13
A2/1/16$14
B2/1/16$15
C2/1/16$16
D2/1/16$17
A3/1/16$18
B3/1/16$19
C3/1/16$20
D3/1/16$21
4 Replies
craigsutton
Creator
Creator

Can you tie a master calendar to the date field then use set analysis to filter by month and year?

craigsutton
Creator
Creator

Something similar to SUM({<[Year]={$(=Year(Today()))}, [Month]={$(=Month(Today()))}>} Sales)

tresB
Champion III
Champion III

Try like:

sum ({< [Month Year] = {'>=$(=MonthStart(Max(Date))) <=$(=MonthEnd(Max(Date)))'} >}  [Sales])

rahulpawarb
Specialist III
Specialist III

Hello Monica,

Trust that you are doing well!

Please refer below given expression:

=Num(Sum({<[Month Year]= {'$(=Date(Max([Month Year]), 'M/D/YY'))'}>}Sales), '$#,##0;($#,##0)')

Hope this will be helpful.

Regards!

Rahul