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: 
Anonymous
Not applicable

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
Clever_Anjos
Employee
Employee

Please make a test with Set Analysis

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

Anonymous
Not applicable
Author

Thanks CA but sorry, no change.

Clever_Anjos
Employee
Employee

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

Could you post a sample of your qvf file?

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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
Specialist
Specialist

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
Specialist
Specialist

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..

Anonymous
Not applicable
Author

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"?

Clever_Anjos
Employee
Employee

qvf is the extension for your app in Sense