Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Akina0929
Creator
Creator

how to compare current month sales and previous month sales?

Hi,

  I want to compare current month and previous month in bar chart.what the expression need to write please help me.

Thanking you,

7 Replies
Anonymous
Not applicable

Hi Anji,

Do you mean you would want to see a graph that showed sales for example, for January to December?

Thanks

qlikview979
Specialist
Specialist

Anil_Babu_Samineni

you will get number of stuff if you start search on Google

Create 2 expressions

1) Sum({<MonthFieldName = {'$(=Max(MonthFieldName))'}>}Sales)

2) Sum({<MonthFieldName = {'$(=AddMonths(Max(MonthFieldName),-1))'}>}Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
avinashelite

qlikview979
Specialist
Specialist

HI

Expecting like this right

Untitled.png

Akina0929
Creator
Creator
Author

No Mathew this year data only

Anonymous
Not applicable

A single expression like this the. Let's use the example that you are looking at sales.

Sum({$<yourDate={'>=$(=MonthStart(AddMonths(Max('yourDate'),-1)))'}>}Sales)

That should do the trick. Only requires one measure and will show you the latest month's sales, with the previous month's sales.