Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
narayanamsn
Creator
Creator

Time comparison

@@Hi Gurus,

I have an example with dummy sales data where in  i need to plot time series Quarterly sales comparison.

I want to derive comparison table that holds the sales with max quarters for each combination.

This table should change the values if I select any Quarter accordingly

@Vishwarath Nagarau vnagaraju

stalwar1    

CompanyRouteMax QtrPre QtrSame Qtr Last YrQ/QY/Y
ARetail180-300=(180 -0 )/0=(180 -300 )/300
Awholesale200150290=(200 - 150 )/150=(200 - 290 )/290
Total380150590=(380 - 150 )/150=(380 - 590 )/590
BRetail120-150=(120 - 0 )/0=(120 - 150 )/150
Bwholesale200150180=(200 - 150 )/150=(200 - 180 )/180
Total320150330=(320-150)/150=(320 - 330)/330
1 Solution

Accepted Solutions
sunny_talwar

1) Nope, one is saying <= second max month year and other is just = to second max month year

2) I don't see why you can't do it... I tried and works the same way

View solution in original post

16 Replies
vishsaggi
Champion III
Champion III

Can you tell me Max Qtr for Retail and Wholesale is 180 and 200? I mean which year? Do you select in year too? Is the above sample data you posted is your expected data?

narayanamsn
Creator
Creator
Author

Hi Vishwarath,

you are correct. Max Qtr is for Max Year. I am expecting the same table that i added

sunny_talwar

What you have listed above is the expected output you are looking to get?

sunny_talwar

This?

Capture.PNG

narayanamsn
Creator
Creator
Author

Yes Sunny

narayanamsn
Creator
Creator
Author

will you be able to share the QVW?

sunny_talwar

Great, I have attached the qvw to my response above... you can see how to do it

sunny_talwar

Open this link for th qvw

Re: Time comparison

vishsaggi
Champion III
Champion III

Sunny Just wondering can we also write like this?

= Max({<Qtr, FYQTR, YearMonth = {"$(=Max(YearMonth,2))"}>}Sales)
//Sum({<YearMonth = {"$(=Max({<Qtr, FYQTR, YearMonth = {[$(='<=' & Max(YearMonth))]}>}YearMonth, 2))"}, Qtr, FYQTR>}Sales)

I get the same results though wanted to know the usage of YearMonth = {[$(='<=' & Max(YearMonth))]}>}?