Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Year Sale in set analysis

I want to find the previous year sale for a particular day

For eg: If i am selecting 24-04-2014

I want to see the sales for 24-04-2013

I dont want to use master calendar

I want to do this in set analysis

Currently I tried this Formula

=Sum({<DATE ={<MakeDate((Year(DATE)-1),Month(DATE),Day(DATE))>}>}NET_AMOUNT)

But there is an error in this formula.

I am not good in set analysis.

Can anyone tell me whats wrong in this or how to achieve this simple in set analysis.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

=SUM({<TransactionDate = {'$(=MakeDate(Year(Today())-1,Month(Today()),Day(Today())))'}>}Amount)

Replace Today() with Date

View solution in original post

4 Replies
PrashantSangle

Hi,

Try like this,

Sum({<DATE={"$(=Date(Addmonths(DATE,-12)))"}>}NET_AMOUNT)

Or

Sum({<DATE={"$(=Date(AddYears(DATE,-1)))"}>}NET_AMOUNT)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MK_QSL
MVP
MVP

=SUM({<TransactionDate = {'$(=MakeDate(Year(Today())-1,Month(Today()),Day(Today())))'}>}Amount)

Replace Today() with Date

Not applicable
Author

Its working fine.

Thank you so much.

Can u share me the expression for MTD & YTD Calculation also

MK_QSL
MVP
MVP

YTD

=SUM({<Date= {'>=$(=YearStart(Today()))<=$(=Today())'}>}Amount)

MTD

=SUM({<Date= {'>=$(=MonthStart(Today()))<=$(=Today())'}>}Amount)

Change Date and Amount with your respective Fields....

Change Today() with your Date in case if you want to give Date selection to users...