Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

if 1st and 2nd column values are match then how to display 3rd column values related to 2nd column

Hi Experts,

Below is the sample data:

Parent Event nameEvent nameEvent id 
AAAcultural22
 dance33
 AAA44
BBBYouth12
 bachelor45
 BBB66

 

 

My requirement is,  if 1st(Parent Event name) and 2nd(Event name) column values are match the need to display the 2nd column corresponding  values of 3rd column( Event id)  in new column (Parent Event Id).

parent event name can repeat in event name column, so need to create new column for parent event ID

Parent Event nameEvent nameEvent id Parent Event Id
AAAcultural2244
 dance33 
 AAA44 
BBBYouth1266
 bachelor45 
 BBB66 

 

presently user only check with event id.

user need to check the data either parent event id or event id.

Please help how we can achieve, i am attaching excel file for data. 

5 Replies
Highlighted

Re: if 1st and 2nd column values are match then how to display 3rd column values related to 2nd col

You want to do this in the script?

Highlighted
Specialist III
Specialist III

Re: if 1st and 2nd column values are match then how to display 3rd column values related to 2nd col

One solution is.

tab1:
LOAD * INLINE [
    Parent Event name, Event name, Event id 
    AAA, cultural, 22
     , dance, 33
     , AAA, 44
    BBB, Youth, 12
     , bachelor, 45
     , BBB, 66
];

map:
Mapping LOAD "Event name", "Event id"
Resident tab1;

tab2:
LOAD *, ApplyMap('map',"Parent Event name",Null()) As [Parent Event Id]
Resident tab1;

Drop Table tab1;

commQV07.PNG

Highlighted
Specialist III
Specialist III

Re: if 1st and 2nd column values are match then how to display 3rd column values related to 2nd col

Hi,

 

Can you try to use Apply map in the script: 

have a look in the below script.

 

Map_parentEvent_ID:
Mapping
LOAD
[Event name],
[Event id]
FROM
[C:\Users\Qlik\Downloads\Parent Data.xlsx]
(ooxml, embedded labels, table is Sheet1);

 

LOAD [Parent Event name],
[Event name],
[Event id],
ApplyMap('Map_parentEvent_ID',[Parent Event name]) as ParentEventID
FROM
[C:\Users\Qlik\Downloads\Parent Data.xlsx]
(ooxml, embedded labels, table is Sheet1);

Output:

mdmukramali_0-1593549069327.png

 

Thanks,

Mohammed Mukram

 

Highlighted
Contributor
Contributor

Re: if 1st and 2nd column values are match then how to display 3rd column values related to 2nd col

Yes Bro

Highlighted

Re: if 1st and 2nd column values are match then how to display 3rd column values related to 2nd col

I guess we already have two script based solution listed by @saran7de  and @mdmukramali . Have you checked those out yet?