Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jmonroe918
Creator II
Creator II

Multiple Line Charts - Hiding Multiple Lines

My line chart is showing a trend line (Month/Year) of data points for several sites. I only want to see them one at a time, not all at once. Or I at least would like to filter out that view and default the "Global" Site (one of the selections).

How do I do that?

My QVW is attached

Thanks

1 Solution

Accepted Solutions
sunny_talwar

May be using a calculated dimension

=If(GetSelectedCount(CPM.Site) = 0, If(CPM.Site = 'Global', CPM.Site), CPM.Site)

You can also modify your expression, but you will need two variables to do this or you can directly use your expression to do this...

PFA the dimension based solution

View solution in original post

8 Replies
sunny_talwar

May be using a calculated dimension

=If(GetSelectedCount(CPM.Site) = 0, If(CPM.Site = 'Global', CPM.Site), CPM.Site)

You can also modify your expression, but you will need two variables to do this or you can directly use your expression to do this...

PFA the dimension based solution

sunny_talwar

Expression based attached

jmonroe918
Creator II
Creator II
Author

Sunny:

Thank you so much for again coming to my rescue. I'm hoping you can answer this question. I applied your Dimension method to the chart I sent to you and it worked perfectly. I then pasted the formula into another chart on my dashboard and I'm getting and additional line (in red) and a dash "-" in the list of sites when the default appears. When I select a site, it goes away and works perfectly until I clear the selection.

Can you tell me why and how to get rid of this? (I ended copying and pasting the table you updated into my dashboard and it doesn't do that. Thanks a lot.

2017-04-10_14-42-41.bmp

sunny_talwar

You just need to select 'Suppress When Value is Null' on the dimension tab for new calculated CPM.Site dimension.

jmonroe918
Creator II
Creator II
Author

Shoot! I should have known that. Everything works great.

Thanks again, my friend.

Jeff

jmonroe918
Creator II
Creator II
Author

Hey Sunny:

I'm trying to add another Expression; a Goal line. It works for the selections but not when nothing is selected. See below.

I've attached my qvw if you don't mind taking a look.

I really appreciate your help.

Jeff

2017-04-11_16-41-28.bmp2017-04-11_16-42-20.bmp

sunny_talwar

Not sure why the calculated dimension alone isn't working in the line chart, I see that it works in the straight table.... but a change in expression works

=If(GetSelectedCount(CPM.Site) = 0, Sum({<CPM.Site = {'Global'}>}Goal), Sum(Goal))

Capture.PNG

jmonroe918
Creator II
Creator II
Author

Perfect! Thanks again Sunny,

Jeff