Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

joeybird
Contributor II

if on same column - qlik sense

hi

I have this in a filter pane

trying to do an if on same column, with no joy

if(match([Department],'Catering','Homeware'),'x',if([Department]=Catering','y','OTHER'))

I cant seem to get y to appear

any help team please

8 Replies
jpenuliar
Valued Contributor III

Re: if on same column - qlik sense

'Catering' is already qualified as 'X' based on the IF condition, therefore 'Y' for 'Catering' does not appear

antoniotiman
Honored Contributor III

Re: if on same column - qlik sense

When result will be 'y' ?

If Department='Catering' then Expr='x'.

joeybird
Contributor II

Re: if on same column - qlik sense

Hi

I just wanted if someone selected x, they would get both those departments

Catering and Homeware

and if they select Y they would get just catering

the rest other, as trying to make a simple quick select filter pane...

is there another method you can suggest please?

Re: if on same column - qlik sense

If there a single quote missing before Catering :

    if(match([Department],'Catering','Homeware'),'x',if([Department]='Catering','y','OTHER'))

joeybird
Contributor II

Re: if on same column - qlik sense

Hi

that was a typo on this forum,

still does not work

please help

antoniotiman
Honored Contributor III

Re: if on same column - qlik sense

May be this :

In Script

LOAD * Inline [
Department,Flag1,Flag2
Catering,y,y
Homeware,x,x
Catering,x,x
]
;

Expression Filter

=Aggr(Only({<Flag1=P(Flag2),Flag1>} Flag1),Flag1)

joeybird
Contributor II

Re: if on same column - qlik sense

Hi

this code, wont achieve the 'other' selection

menu should show

x, y, other

please help

antoniotiman
Honored Contributor III

Re: if on same column - qlik sense

LOAD * Inline [
Department,Flag1,Flag2
Catering,y,y
Homeware,x,x
Catering,x,x

Dep1,Other,Other

Dep2,Other,Other

];