Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
zhujason858_cha
New Contributor II

Exclude value in dimension using set analysis

Data Sample:

YearSum (Qty 1)Sum (Qty 2)

2016

12
201723
2018NULL4

Formula: Sum (Qty 1)/Sum(Qty 2)

Problem: I'm trying to create a line graph of Year vs [Sum( Qty 1) / Sum( Qty 2)]. The graph looks weird because it drops to 0 in 2018 due to the NULL value in Sum (Qty 1). Is there anyway to get the graph to not display year 2018 because Sum (Qty 1) is Null? How would you code that in set expression?

Any help would be greatly appreciated!!

Tags (1)
1 Solution

Accepted Solutions
jonlegall
New Contributor II

Re: Exclude value in dimension using set analysis

Hi Jason,

You can also use : Sum({<Qty1={'*'}>}Qty1) / Sum({<Qty1={'*'}>}Qty2) in order to avoid Null values,

Hope it can help you with your issue,

Regards

JonExclude Value in Dimension.png

5 Replies

Re: Exclude value in dimension using set analysis

May be this

Sum({<Year -= {2018}>}Qty 1)/Sum({<Year -= {2018}>}Qty 2)

zhujason858_cha
New Contributor II

Re: Exclude value in dimension using set analysis

Hey Sunny, thanks for the response. That was my first thought, but I was hoping there would be a way that I could avoid hardcoding a specific year to ignore

Re: Exclude value in dimension using set analysis

May be this

Sum({<Year = {"=Sum(Qty 1) > 0"}>}Qty 1)/Sum({<Year = {"=Sum(Qty 1) > 0"}>}Qty 2)

jonlegall
New Contributor II

Re: Exclude value in dimension using set analysis

Hi Jason,

You can also use : Sum({<Qty1={'*'}>}Qty1) / Sum({<Qty1={'*'}>}Qty2) in order to avoid Null values,

Hope it can help you with your issue,

Regards

JonExclude Value in Dimension.png

zhujason858_cha
New Contributor II

Re: Exclude value in dimension using set analysis

this worked for me, thanks a bunch!