Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner
Partner

Set Analysis Criteria to move with selection

Hi,

I have quite a simple question but can't seem to figure it out.

I have the following formula:

sum({< ProductName = {'CBL*'}>}BALANCE_QTY)

Because I only want to look at products starting with CBL, BUT if I select 1 product with CBL i still want it to move with the selection of that product. Writing the set analysis like this will always show the total of all products starting with CBL.

Hope you can provide me with an answer how to fix this.

Regards, Paul

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

Hi,

you can try this:

=if(GetSelectedCount(ProductName)=0,


sum({< ProductName = {'CBL*'}>}BALANCE_QTY),


sum(BALANCE_QTY)


)

View solution in original post

11 Replies
YoussefBelloum
Champion
Champion

Hi,

you can try this:

=if(GetSelectedCount(ProductName)=0,


sum({< ProductName = {'CBL*'}>}BALANCE_QTY),


sum(BALANCE_QTY)


)

pauldamen
Partner
Partner
Author

Thanks, didn't think about this work around

YoussefBelloum
Champion
Champion

I'm sure there is other solutions for this, in the meantime you can use it

good luck

sunny_talwar

How about this?

Sum({<ProductName *= {'CBL*'}>} BALANCE_QTY)

YoussefBelloum
Champion
Champion

Hi stalwar1‌, this will work when there is no selection on the product and also when there is one product selected ?

sunny_talwar

I was not 100% sure what Paul wanted, but this is what it will do

ProductName

CBL xyz

CBL abc

CBL ddd

JBL xyz

JBL abc

JBL ddd

When nothing is selected... the expression will show this

CBL xyz

CBL abc

CBL ddd

Capture.PNG

When CBL abc is selected.... the expression should show

CBL abc

Capture.PNG

When JBL abc is selected ... the expression will show nothing

Capture.PNG

Updated my post with images and sample

YoussefBelloum
Champion
Champion

it is replacing what I wrote above

sunny_talwar

Your's is slightly different... if you select JBL abc... you will see JBL abc with your expression

Capture.PNG

For the other two cases... it will work the same way

But again, I don't know the requirement and your solution may very well be what is needed here

YoussefBelloum
Champion
Champion

sorrry, it is the fast food effect, I need a coffee ..