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

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

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

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

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)