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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How Can I aggregate Count, Max and Sum

Hello Everyone!

I'd like to ask if it is possible to aggregate Count, Max and Sum functions in one measure. I have been trying, but I have been getting an "expression error" and I don't know what is the issue. Here is my expression:

Count({$<(TimeDiff  - ((max({$<  [ReqStatId] ={3}>} distinct TimeDiff/24  )) - ((Sum ( {$<  [ReqStatId] ={6}>} distinct ReqTime  )  - Sum ( {$<[ReqStatId] ={5}>} distinct ReqTime  )))) ) = {'>=0<24'}, ReqStatId= {3},  PackingId -={160}, CloseDate -= {null} >} distinct  ReqId)

Wishing for your kind cooperation!

Regards,

7 Replies
sunny_talwar

Can you post a screenshot of the expression from where you are using it?

ogster1974
Partner - Master II
Partner - Master II

=AGGR(<YOUR EXPRESSION>, <YOUR GROUP BY VALUE>)

Anonymous
Not applicable
Author

Hello,

Can you give an example please, as I tried what you wrote and it is syntax free however the result is always zero.

Anonymous
Not applicable
Author

I am using this expression in a KPI widget.

reddy-s
Master II
Master II

Hi Freras,

Use this:

aggr(Sum(X),<Field1>,<Field2>,......)

The field list acts as a group by and the sum function performs the aggregation

Anonymous
Not applicable
Author

Thanks Sangram!

Sangram, I am trying to have a count, max and sum functions in the same expression:

here is the idea I want to reach:

Count (Max(x) - (y - z) <=24 && a = 1 && b = 2)

I hope it is clear now .

reddy-s
Master II
Master II

Hi Feras,

Is it possible to attach a sample qvf , so that it will be easy to solve the issue?

Thanks,

Sangram Reddy.