Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

homersimpson
Contributor II

getfieldselections in expression - Problem

Hi,

i make an expression:

Count(DISTINCT{1<price= {"<=3"}, country = {"$(=getfieldselections(country))"}>} sales)

If i select for "country" 1 country like "USA" the chart shows the data

If i select for "country" : "USA", "Germany" the chart doesn´t show the data.

If i test it by this expression the chart shows the correct data:

Count(DISTINCT{1<price= {"<=3"}, country = {"USA","Germany"}>} sales)


What must i do that this expression shows the data?:

Count(DISTINCT{1<price= {"<=3"}, country = {"$(=getfieldselections(country))"}>} sales)


regards,

Fritz


1 Solution

Accepted Solutions
MVP
MVP

Re: getfieldselections in expression - Problem

Try one of these instead:

Count(DISTINCT{1<price= {"<=3"}, country = $::country>} sales)

or

Count(DISTINCT{1<price= {"<=3"}, country =p(country)>} sales)

7 Replies
MVP
MVP

Re: getfieldselections in expression - Problem

Try one of these instead:

Count(DISTINCT{1<price= {"<=3"}, country = $::country>} sales)

or

Count(DISTINCT{1<price= {"<=3"}, country =p(country)>} sales)

MVP
MVP

Re: getfieldselections in expression - Problem

If you do want to go the route of your current method, then you can try this:

Count(DISTINCT{1<price= {"<=3"}, country = {$(=Chr(39) & GetFieldSelections(country, Chr(39) & ', ' & Chr(39), 100) & Chr(39))}>} sales)



homersimpson
Contributor II

Re: getfieldselections in expression - Problem

Hi Sunny,

i have try all your offers, but it doesn´t run.

Is there something to change at Chr(39) i have a german version?

regards,

Fritz

MVP
MVP

Re: getfieldselections in expression - Problem

Chr(39) returns a single quote. Not sure what would be a german version for it.

Besides, would you be able to share a sample to show the issue?

MVP
MVP

Re: getfieldselections in expression - Problem

Hi,

Try this expressions

Count(DISTINCT{1<price= {"<=3"}, country = {"$(=chr(39)  & getfieldselections(country, chr(39) & ',' & chr(39)) & chr(39), 1000)"}>} sales)

Regards,

Jagan.

homersimpson
Contributor II

Re: getfieldselections in expression - Problem

Hi Sunny,

sorry, it was a mistake by me, your solution helps! Thank you very much!

regards,

Fritz

MVP
MVP

Re: getfieldselections in expression - Problem

Awesome , I am glad I was able to help