Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

Dynamic min and max values for Slider Object

Hello,

I have a graph comparing 2 quarters, users can select any 2 quarters to compare and the graph updates accordingly. I am accepting 2 variables from users (each for one quarter) and using set expression for my X axis on the graph.


The expression looks like this -

=Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue)


Now I want to obtain min and max values for the above set expression i.e. the min and max values from my X axis and use that as an input to the slider such that users will have ability to filter the values on X axis (e.g. to weed out the outliers). I will use a variable to capture the threshold set by slider and will show only values greater than the slider threshold. So my above graph expression will be


=IF(Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue) > vthreshold, =Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue))


But when I try to use Min and Max on the above set expression, I get garbage value error


=Min(Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue))


How do I get the min and max values from the above expression i.e. min and max values for my X axis.


Thanks!

1 Solution

Accepted Solutions

Re: Dynamic min and max values for Slider Object

Try this:

For Min:

=Min(Aggr(Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue), YourChartDimensions)


For Max:

=Max(Aggr(Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue), YourChartDimensions)


HTH


Best,

Sunny

3 Replies

Re: Dynamic min and max values for Slider Object

Try this:

For Min:

=Min(Aggr(Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue), YourChartDimensions)


For Max:

=Max(Aggr(Sum({<YearQuarter= {'$(vYearQuarter1)'}>}MValue) - Sum({<Year = {'$(vYearQuarter2)'}>}MValue), YourChartDimensions)


HTH


Best,

Sunny

Not applicable

Re: Dynamic min and max values for Slider Object

worked perfectly! thanks!

Re: Dynamic min and max values for Slider Object

Awesome