7 Replies Latest reply: Jan 14, 2016 3:28 PM by Sangram Reddy

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)

Regards,

• Re: How Can I aggregate Count, Max and Sum

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

• Re: How Can I aggregate Count, Max and Sum

I am using this expression in a KPI widget.

• Re: How Can I aggregate Count, Max and Sum

Hello,

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

• Re: How Can I aggregate Count, Max and Sum

Hi Feras,

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

Thanks,

Sangram Reddy.

• Re: How Can I aggregate Count, Max and Sum

Hi Freras,

Use this:

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

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

• Re: How Can I aggregate Count, Max and Sum

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 .