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

Last 4 Quarter sales

Hi ,

Please guide me how i can sum(sales) for only for last 4 quarter from today.

Please find attached example on same.

Thanks in advance.

18 Replies
srinivasa1
Creator II
Creator II
Author

Thanks Sunny for your quick reply but I wanted see all the values in chart I I mean all the Qtr but in variables  .

See attached screen on same.Qlikissue.png

sunny_talwar

Not sure I understand what you are looking for? You want to save the value 561, 35, 5 and 1 in a variable?

srinivasa1
Creator II
Creator II
Author

Yes your right based on chart selection

sunny_talwar

I am not sure? You want to save them as comma separated values?? I am not sure how you are planning to use them?

srinivasa1
Creator II
Creator II
Author

am fine with comma separated values but end I will do sum of(561+35+5 +1)=602

sunny_talwar

Isn't that what it is doing today?

Capture.PNG

Use this as your variable:

vVar

Sum(Aggr(Count(DISTINCT {<ShipDate = {"$(='>=' & Date(QuarterStart(Max(ShipDate), -3)) & '<=' & Date(Max(ShipDate)))"}, FyQtr, CALENDAR_QUARTER, Year>} Sales), FyQtr))

and use it with dollar sign expansion

srinivasa1
Creator II
Creator II
Author

Yes its doing but in table or chart I would like to see value 431 also but when I  passing into variables then I will skip 431 and considering rest of values for last 4 qtr((561+35+5 +1).this is total based on when user select chart).

Hope it helps

sunny_talwar

1) The variable will change based on selection.

2) You can still display using your regular expression

What is missing?

Capture.PNG

srinivasa1
Creator II
Creator II
Author

Thanks Sunny ,Its very helpful . I need to some work on same to get desired result for my project.

Thanks for all the help.