Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
Honored Contributor III

Re: Min and max value

Check this

Re: Min and max value

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

Re: Min and max value

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


Re: Min and max value

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

Re: Min and max value

Hi

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

Many Thanks

Not applicable

Re: Min and max value

Hii,

Please find the attached qvw for required output.

Thanks & Regards

Prince Anand