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

How to make my chart 1 also work fine , if i not select year = 2015 ?

Hi All

My expression BELOW work fine FOR CHART 1 when i select year = 2015 :-

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

My question is how to make my chart 1 also work fine , if i not select year = 2015 ?

Paul

1 Solution

Accepted Solutions
t_chetirbok
Creator III
Creator III

if I understand you correct try

Sum({<year = {$(=Max(if(getselectedcount(year)=0,2015,year))-1)}

,

month = {"<=$(=Max({<year={$(=Max(if(getselectedcount(year)=0,2015,year)))}, sales = {'*'}>} month))"}

>} REVENUE_C/1000)

View solution in original post

10 Replies
paulyeo11
Master
Master
Author

enclosed my QV doc

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,


Can you please explain with detail. What is the Max year you have. Do you want to have 2015 as max year when no year is selected?

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
t_chetirbok
Creator III
Creator III

hi!

when you don't select year, max year = 2016 and data in your expression = 0, so char doesn't display anything.

Do you want to use 2015 as max year default?

sunny_talwar

When you are selecting 2015, the information on the chart you are seeing is for 2014 because you are using the set analysis

year = {$(=Max(year)-1)}

now when you have nothing selected it is showing 2015 information. You want to see 2014 if you don't select anything? or do you want to see 2015?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

The issue is that your Competitor data is available only for the December Month for all years.

Your default expression takes 2015 as year and month <=3, which doesnt include any competitor and this it is not showing any data,

For 2015 selection the Year in chart becomes 2014 and month becomes <=12, which includes the December month and thus you can see the chart values properly.

If you remove the Month condition from Chart expression, your expression will  work for 2016 selection also.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
t_chetirbok
Creator III
Creator III

if I understand you correct try

Sum({<year = {$(=Max(if(getselectedcount(year)=0,2015,year))-1)}

,

month = {"<=$(=Max({<year={$(=Max(if(getselectedcount(year)=0,2015,year)))}, sales = {'*'}>} month))"}

>} REVENUE_C/1000)

paulyeo11
Master
Master
Author

Hi Tatsiana

look like your expression give me the figure i am looking for.

But you expression have below 2015 , make me wonder why you there it year 2015 ?

if(getselectedcount(year)=0,2015

Paul

paulyeo11
Master
Master
Author

Hi sunny

i think miss Tats expression is correct , because the chart does show the value i need , i guess she make my default year select = 2015 , when i not select any year , and when i select the year=2014 , chart display 2014 sales.

Paul

t_chetirbok
Creator III
Creator III

If you don't make any year selection: if(getselectedcount(year)=0

year will be equal 2015 by default

else year = your selected year

if(getselectedcount(year)=0, 2015, year)