Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ramrongala
Contributor II
Contributor II

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
sunny_talwar

You want to do this in the script?

Saravanan_Desingh

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

mdmukramali
Specialist III
Specialist III

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

 

ramrongala
Contributor II
Contributor II
Author

Yes Bro

sunny_talwar

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