Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
Contributor

Re: Max date in data

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

craigsutton
Contributor

Re: Max date in data

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

MVP
MVP

Re: Max date in data

Try like:

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

rahulpawarb
Valued Contributor II

Re: Max date in data

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

Community Browser