Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Min and max value

Hi ,

How to get the immediate (nearest) min value and immediate (nearest) max value for my selection, if I have some plans like 50,100,200,300,500. If I select the 200 plan, it also should show the min value as 100, max value as 300 for my selection.

6 Replies
anbu1984
Master III
Master III

Check this

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi anbu cheliyan

Small change(Bold) with your logic to get min value. Works if morethan one is selected

Minimum

=Alt(Max({<ID={"<$(=Min(ID))"}>}ID), Min(ID))

Maximum

=Alt(Min({<ID={">$(=Max(ID))"}>}ID), Max(ID))

Not applicable
Author

hi i want to use this in chart's expression, how i can use this?


CELAMBARASAN
Partner - Champion
Partner - Champion

Use

$(=Alt(Max({<ID={"<$(=Min(ID))"}>}ID), Min(ID)))

$(=Alt(Min({<ID={">$(=Max(ID))"}>}ID), Max(ID)))

If you are going to use it in multiple places, then keep it in variable(Ctrl+Alt+V)

Lets say vMinValueExpr equal to =Alt(Max({<ID={"<$(=Min(ID))"}>}ID), Min(ID))

and vMaxValueExpr equal to =Alt(Min({<ID={">$(=Max(ID))"}>}ID), Max(ID))


Use in charts as $(vMinValueExpr) and $(vMaxValueExpr )

Not applicable
Author

Hi

Could you pls explain the inner working of this set exp?

Many Thanks

Not applicable
Author

Hii,

Please find the attached qvw for required output.

Thanks & Regards

Prince Anand