Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ruben_moya
Creator
Creator

Concatenate aggregated field

Dear Experts,

having de following data:

GroupCompanyConsumption
1A1000
1B2000
1C1000
2D1000
2E3000
2F4000

 

Group 14000
Group 28000

 

I need to concatenate the field Company based on a condition in the Consumption of the GROUP they belong. I've been able to get all the Companies concatenated when I aggregate them by Company:

CONCAT(IF(AGGR(sum(Consumption),Company)> 2000,Company),'|')

E|F

But when I try to get the Companies based on a Group agregation it doesn't work. I would expect D|E|F

CONCAT(IF(AGGR(sum(Consumption),Group)> 5000 ,Company),'|')

Could someone explain me why this is happening?

 

Thanks in advance

Labels (2)
1 Solution

Accepted Solutions
SerhanKaraer
Creator III
Creator III

Hi Ruben,

You have to use NODISTINCT parameter in Aggr() function.

CONCAT(IF(AGGR(NODISTINCT sum(Consumption),Group)> 5000 ,Company),'|')

View solution in original post

3 Replies
SerhanKaraer
Creator III
Creator III

Hi Ruben,

You have to use NODISTINCT parameter in Aggr() function.

CONCAT(IF(AGGR(NODISTINCT sum(Consumption),Group)> 5000 ,Company),'|')

ruben_moya
Creator
Creator
Author

That worked perfectñy, thanks a lot.

 

Just curious, what is the logic behind the need of needing nodistinct?

 

Thanks again!

SerhanKaraer
Creator III
Creator III

Aggr's temp table does not fit your current table Ruben.

Here is an explanation with data:

https://community.qlik.com/t5/QlikView-App-Development/What-NODISTINCT-parameter-does-in-AGGR-functi...