Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

using Concat function in a calculated dimension

Hi,

Is it possible to create a calculated dimension for a chart using a concat function?

I tried 2 variants:

1st

='(' & Concat({<Quantity ={"=sum(Quantity)>0"}>}DISTINCT chr(34) & Brands & chr(34), '|') & ')'

2nd

=Concat({<Quantity ={"=sum(Quantity)>0"}>} DISTINCT Chr(39) & Brands & Chr(39),',')


None of them work.

see the file attached.


Thank you in advance,


Larisa

1 Solution

Accepted Solutions
sunny_talwar

this??

Capture.PNG

Dimension: =If(Aggr(Sum(Quantity), Brands)> 0, Brands)

Expression: Sum(Budget)

Uncheck Suppress Zero-Values on Presentation

Check Suppress When Value Is Null

Attaching the qvw for reference.

HTH

Best,

Sunny

View solution in original post

7 Replies
antoniotiman
Master III
Master III

Hi Larisa,

Why don't use Aggr() instead ?

Like

Aggr(If(Sum(Quantity) > 0,Brands),Brands)

Regards,

Antonio

marcus_sommer

You need definitely an aggr to build a calculated dimension:

aggr(Concat({<Quantity ={"=sum(Quantity)>0"}>} DISTINCT Brands,','), Brand)

See: Calculated Dimensions

- Marcus

Anonymous
Not applicable
Author

Hi,

I hope this can help you.

Best regards.

sunny_talwar

What exactly are you trying to do? You want to see a single bar for all the brands where quantity > 0? Is that your requirement?

Best,

Sunny

Anonymous
Not applicable
Author

Hi Giuseppe,

Thank you,

But I can't understand why the condition 'sum(Quantity)>0' doesn't work for this dimension. I want to display only those brands in my dimension where the condition 'sum(Quantity)>0' = truth.

Brands 3,4, 7,8 should not be displayed then.

see the file attached.

Anonymous
Not applicable
Author

Hi Larisa!

Try with this:

=if(Aggr(sum(Quantity),Brands)>0,Chr(39)&Brands&Chr(39) & ' ' & Aggr(if(sum(Quantity)>0,sum(Quantity),0),Brands),'')

sunny_talwar

this??

Capture.PNG

Dimension: =If(Aggr(Sum(Quantity), Brands)> 0, Brands)

Expression: Sum(Budget)

Uncheck Suppress Zero-Values on Presentation

Check Suppress When Value Is Null

Attaching the qvw for reference.

HTH

Best,

Sunny