Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

use setAnalysis on multiple fields matching wildcard mask

Hi community!

Can I use setAnalysis to Count all of the fields which match "*POST" wildcard mask and are holding value of "yes" ?

Or, can you suggest a clever way to do this?

Thank you for your insights!

9 Replies
Not applicable
Author

Please see a doc I have writtent on Set Analysis:

http://community.qlik.com/docs/DOC-4951

The chapters 4.2 and 4.5.2 will give you answers.

Fabrice

Not applicable
Author

Count({<Measure={'*POST','YES'}>}Measure)

Not applicable
Author

Isn't this expression counting Measure fields containing '*POST' and 'YES' strings?

I would like to count all Fields (not just current selection) which mane match '*post' wildcard holding some value, say, 'yes'...

Not applicable
Author

well, in my case, I have to match ALL FIELD NAMES to wildcard and count them if they holding value of, for example, 'yes'...

Not applicable
Author

Hi Marek, As of my understanding, you need to apply the Wildcard match on the Fieldnames.

Count( {1<*POST={'Yes'}>} FieldNameForCounting )

If you need, above type functionality, you need to create the expression dynamically ?

Please confirm this what you need ?

Not applicable
Author

dynamically in means for every row loaded.

example:    

     I have fields named as follows:

          ONE_POST

          TWO_POST

          THREE_POST

          ...

They cane have a value of yes/no. This value is changing from record-to-record while selecting them. I just need to count all of *POST records having value of 'yes'. ok?

Clever_Anjos
Employee
Employee

Create a variable with this

Concat({<$Field={'*POST'}>}$Field&'={"yes"}',',') and then use this variable inside your expressions

sum({<$(yourvar)>}value)

Not applicable
Author

Hi Mareck, As of my understanding , you need to have the expression dynamically like below:

Count({1<ONE_POST={'Yes'}>} ONE_POST) + Count({1<TWO_POST={'Yes'}>} TWO_POST) + ....

If you need above expression dynamically, Use Celver Anjos Method and change logic

Not applicable
Author

Hi Mareck, Please find the below expression. This expression ignores all your current selection and generate the dynamic expression. Define the below expression on UI with vDynamicExp

vDynamicExp = Concat( {1<[$Field]={'*POST'}>} 'count( {1<'&[$Field]&'={"Yes"}>} '& [$Field] &' )', ' + ')  

and call this variable $(=vDynamicExp)