Qlik Community

Qlik Sense App Development

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

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
wdchristensen
Valued Contributor

How to dynamically set the range of a Chart???

How to dynamically set the range of a Chart.

Suppose I have a chart for sales of products (sunblock, Christmas trees, popcorn and gas). For this example, suppose some items are seasonal. Typically, I would suppress zeros which will produce a pretty useful chart. However, when I combine seasonal sales of items like sunblock (summer) with Christmas trees (winter) I don’t see the month(s) with no sales (Sep-18). So what I would like to do is set the charts min value to the first month with sales for the given selection and set the max value to the last month with sales and let the zero values for the months in the middle to appear on the chart. How can this be accomplished? I appreciate the help!  

ExampleProductSales.JPG

Labels (2)
3 Replies
jwjackso
Valued Contributor

Re: How to dynamically set the range of a Chart???

Instead of suppressing zero, suppress missing. Change your formula to something like:
=sum(0) + sum(product)

The sum(0) does not change the value where there is data, but it is also not missing.
wdchristensen
Valued Contributor

Re: How to dynamically set the range of a Chart???

I don't know where the "suppress missing" option is? Under the measure I see a "custom calculation" but I am not sure what formula to use. Additionally, I did try the "suppress nulls" on the dimension which didn't work either. 

 

SuppressZero.JPGMinMaxRange.png

 

 

wdchristensen
Valued Contributor

Re: How to dynamically set the range of a Chart???

https://community.qlik.com/t5/New-to-QlikView/Chart-time-dimension-based-on-min-and-max-dates/m-p/92...

Use Set Analysis with Min and Max Date criteria.

SUM({<Date = {">=$(=Min(Date))<=$(=Max(Date))"}>}Sales)