Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
Count({<Measure={'*POST','YES'}>}Measure)
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'...
well, in my case, I have to match ALL FIELD NAMES to wildcard and count them if they holding value of, for example, 'yes'...
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 ?
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?
Create a variable with this
Concat({<$Field={'*POST'}>}$Field&'={"yes"}',',') and then use this variable inside your expressions
sum({<$(yourvar)>}value)
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
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)