Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
yogitamehta10
Creator
Creator

max date and max -1

HI All,

I'm getting date added in my sheet ramdomly.

i want to calculate sum of  sales where date  is maximum date and  1 less from maximum ,

so latest date and last lastest date.

how should i define it.

 

22/04/2016
28/04/2016
01/05/2020

21 Replies
sunny_talwar

May be like this:

Sum({<date_field={"$(=Date(AddMonths(Max({1}date_field), -1),'DD-MM-YYYY'))"}>}sales)

ioannagr
Creator III
Creator III

Hi Sunny, 

 

this second expression works fine for my case as well. How was I supposed to guess that though? While looking online for a solution i didn't come across this, although you made it look very efficient and easy to solve so thank you.

I looked up "date function arguments qlik sense" but couldn't find it.

Obviously if you get a second argument in Date(), takes you back to the nth previous date (in the format wanted) ?

 

thank you,

Ioanna