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: 
bradley_isaacs
Contributor II
Contributor II

Nested Aggregations

Good day

I need some help with a possible nested aggregation. 

I have the following :

  1) One measure which has an aggregate function(lets call it A)

  2) Another measure with a normal aggregation (lets call it B)

 

I want to count (in another measure), how many values in A is greater than the value in B.  See picture below

Labels (1)
3 Replies
Lauri
Specialist
Specialist

It would be helpful to see your two functions... 

MayilVahanan

Hi @bradley_isaacs 

You can use 

If(Column(1) > Column(2), 1, 0)

And make total function as "Sum"

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
bradley_isaacs
Contributor II
Contributor II
Author

Thanks for Reply Lauri

A:

SUM(Aggr(SUM({$<[KPI Class ID] = {5}>} [KPI Value]) * SUM({$<[KPI Class ID] = {9}>} [KPI Value]), [%KEY_SHIFT] ))
/
sum( {$<[KPI Type ID] = {5}, [KPI Type]=>}[KPI Value])

B:  IF(iSNULL((Avg({<Config_Description={'SV', 'TA'}>}TARGET_VALUE))), Round($(vTA_Target), 0.01),
Round((Avg({<Config_Description={'SV', 'Technical Availability'}>}TARGET_VALUE) ), 0.01)
)