Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

Need Help??

Hi All,

i have one more,

   ID, Date, Sales
     200, 02/02/2015, 250
     300, 02/03/2015, 235
     400, 02/04/2015, 190
     500, 02/05/2015, 290
     600, 02/06/2015, 250
     700, 02/09/2015, 200
      400, 02/04/2016, 190
     500, 02/05/2016, 290
     600, 02/06/2016, 250
     700, 02/09/2016, 200
]

i have 2016 years records also..

but i want compare with today() date only...

like this

Max(date) <=Today()

How to get current Vs previoue month (Means Feb Vs Jan)

How to write in SetAnalysis??

Thanks in Advance...

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Use below expressions

Current Month

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

Previous Month

=Sum({<Date={'>=$(=MonthStart(Today(), -1))<=$(=MonthEnd(Today(), -1))'}>} Sales)


Hope this helps you.


Regards,

Jagan.

View solution in original post

7 Replies
PrashantSangle

Hi,

For Current Month

Sum({<Date={">=(date(Monthstart(Today())))<=date(Today())"}>}Sales)

For Previous Month

Sum({<Date={">=(date(Monthstart(Addmonths(Today(),-1)))<=date(AddMonths(Today(),-1))"}>}Sales)

Note: Modify it according to  Date Format.

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 🙂
mohammadkhatimi
Partner - Specialist
Partner - Specialist

Hi,

Try the following Expression:

For Current Month

=Sum({<Date={'>=$(=date(Monthstart(Today())))<=$(=date(Today()))'}>}Sales)

For Previous Month

=Sum({<Date={'>=$(=date(Monthstart(Addmonths(Today(),-1))))<=$(=date(Addmonths(Today(),-1)))'}>}Sales)


Regards,

Er.Mohammad

paulwalker
Creator III
Creator III
Author

Hi Max,

I am not getting value..

Please can you check once..????

PFA,

PrashantSangle

Hi,

Try with suggestion given by  mohammadkhatimiti

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 🙂
jagan
Partner - Champion III
Partner - Champion III

Hi,

Use below expressions

Current Month

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

Previous Month

=Sum({<Date={'>=$(=MonthStart(Today(), -1))<=$(=MonthEnd(Today(), -1))'}>} Sales)


Hope this helps you.


Regards,

Jagan.

senpradip007
Specialist III
Specialist III

PFA, hope it will help.

kushalthakral
Creator III
Creator III

Dear Paul

i have tried the formula as suggested by Jagan, and it is giving correct result. You can proceed with the formula suggested.

Regards

Kushal T