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

Latest Month EndDate Sales only

hi guys i want to get the latest month end date sales only that means, if present month is march 8 in that case i need to get feb 29 sales.

Can any one help how to achieve that in expression sum(Sales)

Thanks in advance!

Vijay

25 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Use this expression.

Sum({<Date = {"$(=monthend(addmonths(Max(Date),-1)))"}>}Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
nagireddy_qv
Creator II
Creator II

hi

please try this exp..

Sum({<Date = {"$(=addmonths(monthend(Max(Date))))"}>}LineSalesAmount)

Not applicable
Author

Hi kaushik,

your expression will give march 31, In my case , if march 31 still not there then it should take feb 29 date.

Thanks

its_anandrjs

Try this for the last months complete sale on last date.

=Monthend( AddMonths( Max(Today() ), -1) )

Regards,

Anand

Not applicable
Author

Hi nagi reddy the Addmonths(,) should be like this wrong syntax for add months.

Thanks for reply

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

My expression will give Feb 29 when your max(date) is 8th March. This is what you have asked in question, correct me If I am Wrong.

Sum({<Date = {"$(=monthend(addmonths(Max(Date),-1)))"}>}Sales)


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
tresesco
MVP
MVP

Define a variable like:

vRecentMostMonthEnd =If(Today()=Floor(Monthend(Today())), Today(), MonthEnd(Today(),-1))

Then expression like:

Sum({<Date={'$(vRecentMostMonthEnd)'}>} Sales)



Edit: corrected a brace

Not applicable
Author

yes this is correct to get last month last date. in future i get march 31st also at that also it will give only last month last date.

i need a condition if last date is not there in current month than take last month last date....

thanks anand

Not applicable
Author

ya that only i needed buy ur set condition is not working.

Thanks