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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
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?

24 Replies
Not applicable

I have attached sample QVW . Hope this helps.

Regards,

Raksha

arulsettu
Master III
Master III
Author

sorry using personal edition

can you post the code

thanks

Not applicable

Hi

Your FisicalPeriod only include the Month part of the date.

Try to create another field using MonthStart

Then you can select current month instead of like September for every previous years.

Thank you

PC

senpradip007
Specialist III
Specialist III

Try like:

Sum({<FiscalPeriod={'$(=Max(FiscalPeriod)-1)), $(=Max(FiscalPeriod))'} >} Customer)

arulsettu
Master III
Master III
Author

it shows nothing

arulsettu
Master III
Master III
Author

can you show me how

PrashantSangle


Hi,

Write 2 expression:

1st for Current Month:

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

2nd for Previous Month:

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

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 🙂
senpradip007
Specialist III
Specialist III

Try like:

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



jyothish8807
Master II
Master II

Hi Arul,

Your script looks good to me.

Max(month) and current (month)  will be same. if you dont have entries of current month then you wont be able to get current month.

Regards

KC

Best Regards,
KC
arulsettu
Master III
Master III
Author

hi

its showing every month