Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

calculating the maximal value

Hi,

I have a straight table in my application.

It has a dimention = Position

It has an expression which is defined by a variable = $(Reach)

My task is to calculate the maximal Reach in this straight table.

I try to calculate it in a separate text box.

So, I'm trying the following expression:

=max(aggr($(Reach), Position))

But it doesn't work. The result is incorrect.

Could you advise how I can calculate the maximal Reach?

Thank you in advance,

Larisa

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

you should add Aggr function in your variable directly:

aggr( your_expression, Position)

Then, in the text object: =max($(Reach))

Elena

View solution in original post

10 Replies
sunny_talwar

What is the expression that you are using for your variable??

Agis-Kalogiannis
Employee
Employee

Your first attempt with the aggr function looks OK.

Some more info would be useful though!

Anonymous
Not applicable
Author

Hi,

you should add Aggr function in your variable directly:

aggr( your_expression, Position)

Then, in the text object: =max($(Reach))

Elena

ramoncova06
Partner - Specialist III
Partner - Specialist III

what kind of information does you variable has ?

have tried with the max($(Reach)), aggr has a performance toll so if you can avoid using it

Anonymous
Not applicable
Author

If I do this, I get different results:

Reach1 = aggr(my_expression, Position)

Reach2 = my_expression


Reach1 doesn't equal Reach2.


My expression is like this:

(sum({<[Пол/Возраст] = p([ца_Пол/Возраст]), Доход = p(ца_Доход), Занятость = p(ца_Занятость),

  Образование = p(ца_Образование), [Социальный статус] = p([ца_Социальный статус]),

  [Население города] = p([ца_Население города])>}

weight*DaysQty)/$(vPeriod))

Anonymous
Not applicable
Author

My expression is like this:


(sum({<[Пол/Возраст] = p([ца_Пол/Возраст]), Доход = p(ца_Доход), Занятость = p(ца_Занятость),

  Образование = p(ца_Образование), [Социальный статус] = p([ца_Социальный статус]),

  [Население города] = p([ца_Население города])>}

weight*DaysQty)/$(vPeriod))

Anonymous
Not applicable
Author

If I try =max($(Reach)) either directly in a straight table or in a separate text box, I get -.

It isn't calculated.

Anonymous
Not applicable
Author

I tryed with an expression that doesn't contain a variable (while there is one in yours) and it works...

I think, even in vPeriod you have to insert the aggr...

Anonymous
Not applicable
Author

Your original attempt looks correct, I tried with the "sample" script, attached.

Do you get any result in a text box that contains just

$(Reach)

?