Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Max used in an expression

Hi,

I have the following data loaded into a table in Qlikview..  for each call made per code it simply totals it.  so in Qlikview I need to only pick up the "Max" count.

I have tried a few formulas but saw this simple one posted on community but it does not return the correct result.  any help appreciated

=Pick(CallCode= 'HR Calls'',max(Count))

   

AccountRowCountCallCodeCount
1000001HealthCalls1
1000021HR Calls2
1000021HR Calls2
1000501HR Calls1
1000501HealthCalls3
1000501HealthCalls3
1000501HealthCalls3

In qlikview  there is only one line per account so it will end up looking like this:-

   

AccountHealthCalls usedHR Calls used
10000010
10000202
10005031
9 Replies
sushil353
Master II
Master II

Hi,

I am not clear about the expected output.

But using this expression: =Aggr(Max(Count),Account)

the output will be like below:

Let me know if you are looking for something else

HTH

Not applicable
Author

Because qlikview is dynamic, when u use a 'max' it only calculate the data area you had selected. To find the only "max" you can do some tricks in the loading script just like SQL!

Ex:

Max:

LOAD Customer, Max(UnitSales) as MyMax Resident Temp Group By Customer;

FYR: https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/AggregationFunctions/m...

rubenmarin

Hi, I'm not sure of your requirements but Pick() has another use: https://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/ConditionalFunctions/p...

If you make a pivot table with account as horizontal dimension and CallCode as vertical dimension, the expression can be just "=Max(Count)"

Anonymous
Not applicable
Author

thanks Sushil.  I need the results to look like this.  I.e. rather than one row per code like you have.   does this make sense?

AccountHealthCalls usedHR Calls used
10000010
10000202
10005031
sushil353
Master II
Master II

got it,

Please find attached.

HTH

varshavig12
Specialist
Specialist

Anonymous
Not applicable
Author

its now giving the same value in both Call types.  As I have added separate expressions for the call types,  can I add CallCode = "HealthCalls used"   ?

AccountHealthCalls usedHR Calls used
10000011
10000222
10005033
varshavig12
Specialist
Specialist

Aggr(Max({<CallCode={'HealthCalls'}>}Count),Account)

Aggr(Max({<CallCode={'HR Calls'}>}Count),Account)

tamilarasu
Champion
Champion

Hi Laura,

Try like below,

Dimension:

Account

Expression

1. Max({<CallCode={'HealthCalls'}>}Count)

2. Max({<CallCode={'HR Calls'}>}Count)