Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

biggusdoggus
Contributor

Line Graph - not wanting to plot 0

Hey all

This relates to Qlik Sense Server.

So I have a function, sum(if(TRANS_YEAR = 2017, 1,0)).

For a line graph, plotting the results over a 12 month period.

Included on the graph are results for 2015 & 2016 (same function as above, just the year changes, obviously).

Now, the issue I have is while 2015 and 2016 plots fine, because we are only in January for 2017 there is no data for the rest of year. So the function spits out 0.

And while the chart option is available to show missing values as gaps, there's no such option to not plot 0's.

So the line for 2017 drops to 0 from February onwards.

It's probably quite a basic fix, but I'm new to Qlik Sense Server, so can't resolve it on my own. Any help greatly appreciated!

9 Replies
Employee
Employee

Re: Line Graph - not wanting to plot 0

Please make a test with Set Analysis

sum({<TRANS_YEAR = {"2017"}>}1)

biggusdoggus
Contributor

Re: Line Graph - not wanting to plot 0

Thanks CA but sorry, no change.

Highlighted
Employee
Employee

Re: Line Graph - not wanting to plot 0

Are you really summing 1´s or you have a different expression.

Could you post a sample of your qvf file?

biggusdoggus
Contributor

Re: Line Graph - not wanting to plot 0

I'm counting the amount of entries in a server table that the TRANS_YEAR is 2017. Not sure what you mean by a QVF file sorry - pretty sure we don't use them. The table has hundreds of thousands of entries.

biggusdoggus
Contributor

Re: Line Graph - not wanting to plot 0

A thought - how would I modify that function so instead of it returning a 0 it returns NULL - and then so long as I have the option of Show Null Values in the Dimension it wont show anything? Is that even possible?

sdmech81
Valued Contributor

Re: Line Graph - not wanting to plot 0

Hi You r counting,So

Cunt({<TRANS_YEAR = {"2017"}>}TRANS_YEAR)

Hope this helps..

What above you are doing is wrong,for such calculations first u need to Flag those values to 1's and 0's then use set SUM..if this solves issue plss close it..

sdmech81
Valued Contributor

Re: Line Graph - not wanting to plot 0

Ohh I gt u nw..

1)Plss try adding above expression into variable and then in chart say

=only(<{Var-=0}>Var)

2)Or limit those dimension fr which var=0 in calculated dimension using if condition.

Hope ths helps..

biggusdoggus
Contributor

Re: Line Graph - not wanting to plot 0

Hi Sachin

Thanks for the responses.

I don't fully follow though sorry - the Count({<TRANS_YEAR = {"2017"}>}TRANS_YEAR) works fine (as in, it brings back the right value for January, but still shows zeroes for the rest of the year).

But where does =only(<{Var-=0}>Var) fit in - where does that get applied "in the chart"?

Employee
Employee

Re: Line Graph - not wanting to plot 0

qvf is the extension for your app in Sense