Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: use setAnalysis on multiple fields matching wildcard mask

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

Re: use setAnalysis on multiple fields matching wildcard mask

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

Not applicable

Re: use setAnalysis on multiple fields matching wildcard mask

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

Re: use setAnalysis on multiple fields matching wildcard mask

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

Re: use setAnalysis on multiple fields matching wildcard mask

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

Re: use setAnalysis on multiple fields matching wildcard mask

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?

Employee
Employee

Re: use setAnalysis on multiple fields matching wildcard mask

Create a variable with this

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

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

Not applicable

Re: use setAnalysis on multiple fields matching wildcard mask

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

Re: use setAnalysis on multiple fields matching wildcard mask

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)

Community Browser