Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use a variable into set analysis expression - Help!

Hello my friends,

I've the variable vFiltro

vFiltro = GetFieldSelections(Fato)

And I wrote this set analysis expression:

=Count({$<Fato={'$(vFiltro)'}>} DISTINCT %IDSalesForce)

When selected one value in my listbox 'Fato'..., display '0' when the expected is 688.

Why? Thanks

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

For selections try this

=Sum({<Produto={'$(=vTest)'}>}x)

For inverse selection try this

=Sum({1-$<Produto={'$(=vTest)'}>}x)

Have a look at attached application

Regards

ASHFAQ

View solution in original post

12 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

may be try like this

=Count({$<Fato={'$(=vFiltro)'}>} DISTINCT %IDSalesForce)


Regards

ASHFAQ

Not applicable
Author

Hi Ashfaz!

But i try this...

And doesn't work

ashfaq_haseeb
Champion III
Champion III

Hi,

Can you post sample application

Regards

ASHFAQ

JonnyPoole
Former Employee
Former Employee

Does Fato have spaces in it ?  in your example,  if you put the following in a text box, what is the result"

=GetFieldSelections(Fato)

You may need to use   =GetFieldSelections(Year,chr(39)&','&chr(39))

which would give this which is needed for certain values in a modifier..

My town','your town','two words','oneword

maxgro
MVP
MVP

if you make a textbox with

=GetFieldSelections(Fato)

what is the result in textbox?

Not applicable
Author

I made a example...

When i select one Product in my listbox, i want to see the sum minus the item selected in my list box 'Produtos'.

In the text box yellow, have the code:

=Sum({<Produto=E({1<Produto={'=GetFieldSelections(Produto)'}>})>} x )

But it doesn't work...

Why?

ashfaq_haseeb
Champion III
Champion III

Hi,

For selections try this

=Sum({<Produto={'$(=vTest)'}>}x)

For inverse selection try this

=Sum({1-$<Produto={'$(=vTest)'}>}x)

Have a look at attached application

Regards

ASHFAQ

Not applicable
Author

Yep!

ashfaq_haseeb
Champion III
Champion III

Hi,

If it answered, can you close this thread by selecting appropriate answers?

Regards

ASHFAQ