Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to use multiple min and multiple max values in one expression for MIN and one expression for MAX?


Hi,

I need to show below expressions in two. one for Min and another for Max in combo chart as symbols

Min expressions are

min(Aggr([Parent to Child],StartDate,[Parent to Child]))

min(Aggr([Grandparent to Parent],StartDate,[Grandparent to Parent]))

min(Aggr([Daugther to Son],StartDate,[Daugther to Son]))

min(Aggr([Teacher to Student],StartDate,[Teacher to Student]))

Max expressions are

max(Aggr([Parent to Child],StartDate,[Parent to Child]))

max(Aggr([Grandparent to Parent],StartDate,[Grandparent to Parent]))

max(Aggr([Daugther to Son],StartDate,[Daugther to Son]))

max(Aggr([Teacher to Student],StartDate,[Teacher to Student]))

I am trying with Dual function to add all min expressions in one expression as MIN and all max expressions in one expression as MAX

Please can anyone suggest me is it possible? if so how to use it?

Thanks.

8 Replies
swuehl
MVP
MVP

Try using RangeMin() / RangeMax() functions:

=RangeMin(

min(Aggr([Parent to Child],StartDate,[Parent to Child])),

min(Aggr([Grandparent to Parent],StartDate,[Grandparent to Parent])),

min(Aggr([Daugther to Son],StartDate,[Daugther to Son])),

min(Aggr([Teacher to Student],StartDate,[Teacher to Student]))

)

MK_QSL
MVP
MVP

Please clarify little more... What do you mean by add all min expressions in one expression as MIN?


Are you trying to find out Min of all these min ?

then use..


RangeMin(

min(Aggr([Parent to Child],StartDate,[Parent to Child]))

,min(Aggr([Grandparent to Parent],StartDate,[Grandparent to Parent]))

,min(Aggr([Daugther to Son],StartDate,[Daugther to Son]))

,min(Aggr([Teacher to Student],StartDate,[Teacher to Student]))

)

Same way you can use RangeMax

Not applicable
Author

Thanks. How can I add remaining values in below expression

=Dual(

Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.5)&Chr(13)

&'Box Plot Bottom = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.25)&Chr(13)

&'Box Plot Top = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.75)&Chr(13)

&'Box Plot Lower Whisker = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.05)&Chr(13)

&'Box Plot Upper Whisker = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.95)&Chr(13)

,Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.75)-Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.25))

in the same expression would it be possible to add [Grandparent to Parent], [Daugther to Son], [Teacher to Student]

MK_QSL
MVP
MVP

What are you trying to do here?

Your initial question is different and now you are asking Dual with Fractile ... !

Can you post sample data with more specific information please?

Not applicable
Author

sorry Dual with Fractile is another expression that I need to use

swuehl
MVP
MVP

Your dual() consists of two parts, first argument is a text value to use for text representation of the dual value, second argument is the numeric part.

It's unclear how you want to incorporate the RangeMin() function here, I guess you want to add it to the text representation:

=Dual(

Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.5)&Chr(13)

&'Box Plot Bottom = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.25)&Chr(13)

&'Box Plot Top = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.75)&Chr(13)

&'Box Plot Lower Whisker = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.05)&Chr(13)

&'Box Plot Upper Whisker = '&Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.95)&Chr(13)

&'Min Value = ' &

RangeMin(

min(Aggr([Parent to Child],StartDate,[Parent to Child])),

min(Aggr([Grandparent to Parent],StartDate,[Grandparent to Parent])),

min(Aggr([Daugther to Son],StartDate,[Daugther to Son])),

min(Aggr([Teacher to Student],StartDate,[Teacher to Student]))

) & chr(13)

&

'Max Value = ' &

RangeMax(

Max(Aggr([Parent to Child],StartDate,[Parent to Child])),

Max(Aggr([Grandparent to Parent],StartDate,[Grandparent to Parent])),

Max(Aggr([Daugther to Son],StartDate,[Daugther to Son])),

Max(Aggr([Teacher to Student],StartDate,[Teacher to Student]))

) & chr(13)

,Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.75)-Fractile(Aggr(Parent to Child,UPdate,Parent to Child), 0.25))

Not applicable
Author

Thanks. I want to add Dual Fractile as one expression, MIN values as second expression and MAX values as third expression. I do not want to join all the three in one expression.

would it be possible as separate expressions one for Dual Fractile, other for MIN and another for MAX

swuehl
MVP
MVP

In general, it should be possible, to use these 3 expressions

You might get issues depending on the chart type and chart settings using multiple expressions, and also note that using aggr() also often shows some pitfalls:

Pitfalls of the Aggr function

I noticed that you want to use advanced aggregation excessively with similar or same dimensions, and we are unclear about the outer chart dimensions you are using, so take care specifically of the chapter about grain mismatch in above blog post.