Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Min or Max of a calculated expression

Hello,

I have been struggling too long so I ask for your kind help.

My goal is to fill in a variable with the max of the following expression. I need to get a single value at the end.

I have a table with 2 columns

dimension: it'a cyclical group with the first dimension equal to Jour=Date(date_occ-(year(date_occ)-v_AnneeRef)*364,'DD/MM/YY')

It is used to compare equivalent day between different years. A monday with a monday A tuesday with a tuesday etc

So I have several date_occ already aggregated under each "jour"

Expressions:

Demande: =($(vExpr_nombrededemandes))/count(DISTINCT{$< statut_option= , statut_affaire={"*"}> } ANNEE_OCCUPATION)

vExpr_nombrededemandes= (Count({$< libel_segment={"*"}-{'Salles expos/orgas'}-{'Autres'}, statut_option= , statut_affaire={"*"}-{'IMMOBIL'}>}  DISTINCT mot_directeur) )


DATA.PNG

Thanks a lot

Tags (3)
1 Solution

Accepted Solutions
Highlighted

Re: Min or Max of a calculated expression

26 Replies
Highlighted

Re: Min or Max of a calculated expression

It might be easier to help if you are able to share a sample to play around with.

Highlighted
Contributor II
Contributor II

Re: Min or Max of a calculated expression

Hello

I attached a sample the goal is still to display the max of the calculated field 'average demand'

thanks

Edouard

Highlighted

Re: Min or Max of a calculated expression

This seems to work for the sample... but not sure if it still works for the real scenario or not

=Max(Aggr(($(vExpr_nombrededemandes))/(count(DISTINCT{$< statut_option= , statut_affaire={"*"}> } ANNEE_OCCUPATION)), date_occ))

Highlighted
Contributor II
Contributor II

Re: Min or Max of a calculated expression

Hello

Thanks for this first answer.

I get 10 when I use this formula which is the max of demand. I am looking for the max of "average number of demand"  in the TABLE 1

Thank you so much

Highlighted

Re: Min or Max of a calculated expression

And there is no way you can calculate your calculated dimension in the script?

Highlighted
Contributor II
Contributor II

Re: Min or Max of a calculated expression

No,

Because the hierarchical group uses a variable v_AnnéeRef.

Is there still a way or it is just not possible?

Highlighted

Re: Min or Max of a calculated expression

I will keep looking for a little bit, but I don't think there is a way to do this.

Highlighted

Re: Min or Max of a calculated expression

I don't think I know a way to do this... but may be swuehl‌ or marcowedel‌ can offer there expert advice.

Best,

Sunny

Highlighted
Contributor II
Contributor II

Re: Min or Max of a calculated expression

Maybe with a firstsortedvalue? But I don't master this formula