Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
nina_jensen
Not applicable

How to combine field values from two fields and then select specific values

Hi :-)

I have two tables - Code1 and Code2.

I have made a Filter Pane with Code1 as dimension and I want to show only higlighted blue codes from table Code1 and Code2 in the filter pane for Code1.

Whenever code XX appears in table Code1 it shall be replaced with Code2, but not all - only specific codes are to be shown in Code1.


I have managed to get XX replaced in Code1 with (not sure if this is the correct way to do it, but the codes were replaced).


if(code1='XX', [code2], code1)


But from here I am not able to find the right expression as I am not too familiar with expressions or set analyse.


Code1Code2
ABDE
ABDF
ADAB
CDAC
XXAB
XXAB
XXCD

Wanted result in Filter Pane for Code1

Code1
AB
AB
AD
AB
AB

I am using Qlik Sense Server, v3.x

9 Replies
rupamjyotidas
Not applicable

Re: How to combine field values from two fields and then select specific values

Is it always 'XX' getting replaced with 'AB'

Then

if(code1='XX', 'AB', code1) as code1

rupamjyotidas
Not applicable

Re: How to combine field values from two fields and then select specific values

if(code1='XX', 'AB',if(wildmatch( code1,'A')>0,code1)) as code1

rupamjyotidas
Not applicable

Re: How to combine field values from two fields and then select specific values

oops forgot the'*', i need to close the lappy i guess:-)

if(code1='XX', 'AB',if(wildmatch( code1,'A*')>0,code1)) as code1

nina_jensen
Not applicable

Re: How to combine field values from two fields and then select specific values

Thank you for your answer.

It is not always replaced with AB - have 12 different values and need to name them specific.

The code XX have 12 possible codes that shall be replaced from table Code2 to table Code1 and about 80 codes that shall not be replaced.

rupamjyotidas
Not applicable

Re: How to combine field values from two fields and then select specific values

nina_jensen
Not applicable

Re: How to combine field values from two fields and then select specific values

OK, that looks like a possible solution.

I'll give that a try.

Thank you again Rupam DAS

rupamjyotidas
Not applicable

Re: How to combine field values from two fields and then select specific values

if it works, probably best to  close the discussion by marking 'correct answer' :-)

nina_jensen
Not applicable

Re: How to combine field values from two fields and then select specific values

I will as soon as I have checked it out  ;-)

nina_jensen
Not applicable

Re: How to combine field values from two fields and then select specific values

The mapping did not solve the problem as I have too much variables.

I was able to solve it by using an expression on the filterpane and adding a bookmark.