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

Does SET expression allow user select yr=2016 and mth =12 and still able to display value ?

Hi All

My Table have below expression display YTD sales work fine  :-

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

And below display YTD LY sales :-

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

My question is when user need to compare whole year 2015 vs 2016 from Jan till june sales , user click on year=2016 and month = 12

the table display null value.

May i know how to make it display YTD sales amount for both column ?

Paul

1 Solution

Accepted Solutions
paulyeo11
Master
Master
Author

Hi Antonio

Thank you very much , this is what i am looking for.

Paul

View solution in original post

12 Replies
paulyeo11
Master
Master
Author

my qvw

PrashantSangle

Hi,

In PY YTD dont set month field.Nullify it.

Try like,

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


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 🙂
MK_QSL
MVP
MVP

Not clear from your explanation. Can you provide output which you are looking for?

Anonymous
Not applicable

You try to use ADDMONTHS() & ADDYEARS() to your previous year & Month .

antoniotiman
Master III
Master III

Try to remove

,sales={'*'}

or replace with

,sales=

PrashantSangle

Hi,

or you can simply set Month value in set analysis for PY YTD.

try like,

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


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 🙂
paulyeo11
Master
Master
Author

Hi Antonio

Thank you very much , this is what i am looking for.

Paul

paulyeo11
Master
Master
Author

Hi Max

i try it return null value.

Paul

paulyeo11
Master
Master
Author

Hi Manish

I have already got the solution on this post , and i have mark correct answer. , that is :-

Try to remove

,sales={'*'}

or replace with

,sales=

Today i learn 2 thing about

,sales={'*'}

1) This allow user not select any value and it will select june.

2) if {'*'} are remove user can select mth =12 and yr=2016 and it can display value.

Paul