Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

When current year and month is not selected , how to compute LY YTD sales ?

Hi All

Table 1 is my SET expression need to select the current month and year.

sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>}sales/1000)

Now i can only achieve using , Flag , may i know how to make use of SET ?

Sum(if(LY_YTD,sales))

May i know how to modify the above expression so that i don't need to select current year and month ?

Paul

1 Solution

Accepted Solutions
sunny_talwar

Try this may be:

Sum({$<year = {$(=Max(year)-1)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1)

View solution in original post

5 Replies
sunny_talwar

Try this may be:

Sum({$<year = {$(=Max(year)-1)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1)

paulyeo11
Master
Master
Author

Hi Sunny

Thank you for help on on sales expression , Now i need help on when current year and month is not selected , how to compute LY YTD rEVENUE ?

Table 1 is my SET expression need to select the current month and year.

=SUM({<year = {"$(=Max(year)-1)"},month={"<=$(=month)"},rEVENUE={rEVENUE}>}Amount*1)/$(Columndim89)/1000

May i know how to modify the above expression so that i don't need to select current year and month ? , and Table can display 110 , now display 0

i know i need insert rEVENUE = {'*'} into above expression. But not sure where to plug in. As this expression is total different my previous sales expression.

Paul

sunny_talwar

Check the attached

paulyeo11
Master
Master
Author

Hi Sunny

Thank you so much. May I ask it is okay for me to use the same thread for similar issue ? Or you prefer me open new thread ?

Paul

Sent from my iPhone

sunny_talwar

I think its better to open new threads for a new issue because it will help you get more exposure from other people who are willing to help, but may not check a closed thread.