Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
userost123
New 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

Re: Aggr concat and if statement in dimension

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

Re: Aggr concat and if statement in dimension

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

Support
Support

Re: Aggr concat and if statement in dimension

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 don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.