Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

Current Month v. Same Month Last Year

Hi Everyone

I have ticketing application which logs number of calls per month. I have data for 5 years. I want to calculate what variance between calls during same period last year around same month to guage the trend.

How do I go about doing this.

please help.

thanks

18 Replies
userid128223
Creator
Creator
Author

Thanks Kumar & Neha.

But your solution does not work. I need to be able to select any point in data and it will show data from same month previous year.

Hi Vivek

Waiting for your reply. I think we were close.

thanks

Gysbert_Wassenaar

See attached example

edit: see here for an explanation of the approach used.


talk is cheap, supply exceeds demand
userid128223
Creator
Creator
Author

Hi Gysbert

Can you please explain how it works.

is it possible for you to do it with variable the way Vivek was doing. He simple did not have time to complete.

My concern is how i can replicate this way in my script with left join as i have multiple tables. Variable options sounds much better.

vivek_niti
Partner - Creator
Partner - Creator

Hi,

please find the attahced file...

Have made some changes in the variables...

Hope it works for you...

Regards,

Vivek

userid128223
Creator
Creator
Author

Thanks Vivek

but it still does not give me right answer. if i select jan 2013, it should show previous year jan 2012 numbers along side, which it does not show.

Not applicable

you can try this expression in Vivek's example qvw....

=if (len(GetFieldSelections(MonthYear))=0,

sum({<IncidentDate_num={'>=$(vPrevMonthStart)'}, IncidentDate_num={'<=$(vPrevCurrDate)'}>}NoOfCalls),

sum({<MonthYear={'$(=Left(MonthYear,4)&num(right(MonthYear,4)-1))'}>}NoOfCalls))

vivek_niti
Partner - Creator
Partner - Creator

Hi,

the formula works fine...if u select jan 2013 it shows the total value of jan 2012.

sum({<Year=,Month=,MonthYear=,IncidentDate_num={">=$(vPrevMonthStart)<=$(vPrevEndDate)"}>}NoOfCalls)

Regards,

Vivek

userid128223
Creator
Creator
Author

Hi Vivek

its not working for me. Let me ask you question differentely

If i have month, year, date and I have data.

I have columns that shows month sales. How can i shows (via generic formula) same month previous year sales data right next to it.

userid128223
Creator
Creator
Author

Hi Gysbert

Thanks for you help. I am still having hard time understand the concept but your solution does work.