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

get current month vs previous month

hi

i am trying to show current month vs previous month in bar chart

what i did is

sum({<FiscalPeriod={$(=max(FiscalPeriod)),$(=max(FiscalPeriod)-1)}>}Customer)

it shows maximum month and previous month

how can i show current vs previous month any help?

1 Solution

Accepted Solutions
Not applicable

Try this,

if you are looking for Current and previous month,

sum({<FiscalPeriod={$(=max(Num(Month(Date(Today()))))),$(=max(Num(Month(Date(Today()))))-1)}>}Customer)

View solution in original post

24 Replies
sushil353
Master II
Master II

Try this:

sum({<FiscalPeriod={"<=$(=max(FiscalPeriod)) >=$(=max(FiscalPeriod)-1)"}>}Customer)

arulsettu
Master III
Master III
Author

hi

it showing the same

sushil353
Master II
Master II

what are the values in your FiscalPeriod..

Can u post a sample data

Not applicable

I think , you can get the current month and then compare.

like something below:

sum({<FiscalPeriod={"<=$(=Month(date(today()))) >=$(=Month(date(today()))-1)"}>}Customer)

if format is different ,change the format of month accordingly.

Regards,

Raksha

arulsettu
Master III
Master III
Author

months

1 2 3 4 5 6 7 8 9 10 11 12

anbu1984
Master III
Master III

Can you post sample qvw

senpradip007
Specialist III
Specialist III

Try like

Sum({<FiscalPeriod={">=$(=MonthStart(AddMonths(Max(FiscalPeriod),-1))) <=$(=Max(FiscalPeriod))"} >} Customer)

arulsettu
Master III
Master III
Author

it shows every month

arulsettu
Master III
Master III
Author

here