Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Wildcard for more tha one value

Hi,

I have this wildcard into a set analisys sentence:

sum({$<Par={'*$(=All_about)*'}>}MLoc)

It works perfectly when I choose one value for the field 'All About' but I would like to choose several values, and make that the set analisys sentence works as if it has an 'OR' condition considering all the selected values.

How could I write this sentence to get this result?

Thanks

1 Solution

Accepted Solutions
MVP
MVP

Re: Re: Re: Wildcard for more tha one value

PFA

9 Replies
MVP
MVP

Re: Wildcard for more tha one value

Maybe something like

sum({$<Par={ $(=concat(distinct chr(39)&'*'&All_about&'*'&chr(39),',') }>}MLoc)

Not applicable

Re: Wildcard for more tha one value

Sorry but it does not give me any value.

In fact qview thinks it is a variable from the '$' to the end of the expression because the font is grey from there.

Maybe it is a syntax errro but I do not know how to mend it.

Thanks.

Re: Wildcard for more tha one value

swuehl is just missing an ending parenthesis.  It should be:

sum({$<Par={ $(=concat(distinct chr(39)&'*'&All_about&'*'&chr(39),',')) }>}MLoc)

Not applicable

Re: Re: Wildcard for more tha one value

Thanks but it does not work, maybe I did not explain myself enough,

The list box 'All_about' has members of 3 characters except for one.

allabou.png

When I filter the field 'Par' by the set analysis expression 'sum({$<Par={'*$(=All_about)*'}>}MLoc)' it works OK only if I choose only one value ('ASI' for example) in the 'All_about' list box.

But if I choose two or more values in the list, like in the attached image, there is no filtering at all so it is not what I need.

If I choose two values like in the image, I would need that the pivot table (which has the expression) sum the values of 'Par' for 'ASI' and the values of 'Par' for 'DCP' and no other value. The same if I choose three or more values.

Thank you


mov
Esteemed Contributor III

Re: Wildcard for more tha one value

Maybe this:

sum({$<Par={"$(=chr(39)&'*' & concat(distinct All_about, '*'&chr(39)&','&chr(39)&'*') & '*'& chr(39))"}>}MLoc)

Edit: forgot chr(39) - fixed now

mov
Esteemed Contributor III

Re: Wildcard for more tha one value

In fact, my concat part returns the same as from Nicole and Stefan.  The difference is that there should be quotes around the $(=<expression>):

sum({<Par ={"$(=<expression>)"}>} MLoc)

Not applicable

Re: Re: Wildcard for more tha one value

Hi ,

I was not able to make it work so I have attached file with an example.

I show two selections in the image but I need to solve any number of selected items.

Thanks

Multiple Selection.png

MVP
MVP

Re: Re: Re: Wildcard for more tha one value

PFA

Not applicable

Re: Re: Re: Wildcard for more tha one value

Perfect, thank you very much.

Community Browser