Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
userost123
Contributor II
Contributor II

Aggr concat and if statement in dimension

Hello everyone.

I am trying to get a table with one calculated dimension. In this dimension I am concatinating by filed PRODUCT and aggregating by customer. The expression I am using  is next :

=Aggr( Concat(DISTINCT PRODUCT,'+',PRODUCT),CUSTOMER) .

This expression works fine and I get the result I want.

I am now trying to put some IF statement on top of this, since I want this expression to be 'calculated' only in a case where two fields from two different tables are the same. Fields names are 'PRICE_ID' and 'PRICE_ID_PRODUCT'.
So I am trying with next expression:

If( PRICE_ID=PRICE_ID_PRODUCT, Aggr( Concat(DISTINCT PRODUCT,'+',PRODUCT),POGODBA_ID), Null())

When I try using this calculated dimension, I get Calculation Time out Error and I don't get any result.


If you have any idea how could I use IF statement in this case, please help. Thanks.

 

 

1 Solution

Accepted Solutions
sunny_talwar

I am not entirely sure what you are doing, but may be try this

Aggr(
    If(PRICE_ID = PRICE_ID_PRODUCT, Concat(DISTINCT PRODUCT, '+', PRODUCT), Null())
, POGODBA_ID)

View solution in original post

2 Replies
sunny_talwar

I am not entirely sure what you are doing, but may be try this

Aggr(
    If(PRICE_ID = PRICE_ID_PRODUCT, Concat(DISTINCT PRODUCT, '+', PRODUCT), Null())
, POGODBA_ID)
Brett_Bleess
Former Employee
Former Employee

Sabrina, did Sunny's post get you a working solution?  If so, do not forget to return to the post and use the Accept as Solution button on his answer post to mark it as the solution, as this will give him credit for the help, and it will confirm to other Community members that it did work.  

The only thing I have for you are the following links that may be helpful:

https://community.qlik.com/t5/Qlik-Design-Blog/Conditional-Aggregations/ba-p/1473362

There are some other AGGR related posts in the Design Blog area too, below is the base URL for the area if you want to do some further searching on your own, but I figured the above was along the right lines of what you were trying to do...

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.