Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
mlarruda
Creator II
Creator II

How can I set the limits of a bar graphic without do many changes in the dimension?

Hi, I have a bar graphic with the following dimension:

= if(VALUE <=10000, Dual( '$ 0,01 until $ 10 k', 5000.01),
if(VALUE <=20000, Dual( '$ 10.000,01 until $ 20 k', 10000.01),
if(VALUE <=30000, Dual( '$ 20.000,01 until $ 30 k', 20000.01),
if(VALUE <=40000, Dual( '$ 30.000,01 until $ 40 k', 30000.01),
if(VALUE <=50000, Dual( '$ 40.000,01 until $ 50 k', 40000.01)
)))))

And I would like to change the bar to show other VALUE ranges. Is it possible to do it without need to change all bounds into the dimension formula?

E.g.: Would it be possible that I set somewhere only the lower and the upper bounds and the chart automatically shows five bars corresponding to five ranges with equal width?

Many thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
mlarruda
Creator II
Creator II
Author

I solved, using the dimension below and setting (in Dimensions tab) to do not show null values:

class(if(VALUE < 10000,'',if(VALUE > 20000,'', VALUE)),1000,'value',0.01)

Anybody thinks there is a better solution?

View solution in original post

3 Replies
bramkn
Partner - Specialist
Partner - Specialist

the class() function. look it up you will like it. 🙂
mlarruda
Creator II
Creator II
Author

Thank you for the hint, but it still has some problems: using the dimension class(VALUE,1000,'value',10000.01), I got several bars, from "1000,01 <= value < 2000,01" to "44000,01 <= value < 45000,01". So:

1 - Since I defined the off-set parameter as 10000.01 (see in bold), why the first bar was "1000,01 <= value < 2000,01" rather than "10000.01 <= value < 11000.01"?

2 - How can I make the graphic show only the bars until, say, "19000.01 <= value < 20000" rather than all bars until the maximum value of my data?

mlarruda
Creator II
Creator II
Author

I solved, using the dimension below and setting (in Dimensions tab) to do not show null values:

class(if(VALUE < 10000,'',if(VALUE > 20000,'', VALUE)),1000,'value',0.01)

Anybody thinks there is a better solution?