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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
dreweezy
Creator II
Creator II

handling null values in line chart

Hello, I have a line chart with multiple lines (these lines were manually created as our data is not pivoted to handle). Now, when a user goes and selects a value from a filter pane, it will show that specific line, but the other lines all drop to 0 on the x axis. I was hoping, upon selection of a value from the filter, it will only show 1 line but instead just drops the rest down to 0. Here is a snip of my problem.

How do I make it so upon selecting a filter value, the chart will only display that one line? I've tried excluding null values on the properties section and that doesn't do it. 

Capture.PNG

 

Thanks.

1 Solution

Accepted Solutions
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Please find the solution in the attachment

Hope it helps

Thanks

Thanks and Regards
Kashyap.R

View solution in original post

12 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hello Dreweezy,

 

You can hide it by placing a condition in the expression itself such as:

If (condition, Sum(LineAmount), Null())

And hide the legend if you have any.

 

But still the proper way is to make sure you've designed your chart as a line chart with 2 dimensions (Year and this dimension represented by the separate lines). There is no conditional show to turn it off.

Also - make sure to sort your chart by Year. 😉

 

I hope that helps!

 

Kind regards,

S.T.

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try by unchecking the "Include zero value" under  Add-ons >> Data Handling.

Hope this helps

Thanks

 

Thanks and Regards
Kashyap.R
dreweezy
Creator II
Creator II
Author

I understand what you're saying. 

Here is my condition for this chart. I will have multiple if statements. 

if(Sum({<[DEPARTMENT] *= {'Marketing'}>} [REVENUE] > 0, 1, 0))

Not working right now, I need to work on my syntax  but will this syntax work for the individual line itself? 

dreweezy
Creator II
Creator II
Author

So I updated my condition so it says 

if(sum(REVENUE= 0), 0, 1)

My thinking is with the 4 lines I have, since I select 1 value from the filter pane it will show me that line, and since the rest of the values are 0 it will not display. However, it leaves me in the same spot. The other lines are being pushed to the bottom at 0 on the x axis even with the condition in place. 

Here is an updated snip. 

Capture.PNG

Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Try Null() instead of 0.

dreweezy
Creator II
Creator II
Author

I have uploaded a simple app with similar data. You can see if you select just one department, the other 2 line values go down to 0 on the x axis. 

dreweezy
Creator II
Creator II
Author

I've tried but no luck on this. 

santho_ak
Partner - Creator III
Partner - Creator III

Hi,

If possible, try changing that particular filter as 'alternate filter'. In that way, user will be able to select only one filter at a time. You can do so within the properties panes.

Regards,

Santhosh

 

Notes:

 Alternative dimensions and measures are dimensions and measures that are added to a visualization, but are not displayed until a user chooses to switch which dimensions and measures are being displayed during visual exploration.

https://help.qlik.com/en-US/sense/September2019/Subsystems/Hub/Content/Sense_Hub/Visualizations/Comb...

dreweezy
Creator II
Creator II
Author

I do not want to limit # of filters a user can select. I'm just a bit confused as to why the other line are being pushed down. I'm unsuccessful using the calc condition to display or not. I will update once I find a solution.