- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 name | Event name | Event id |
AAA | cultural | 22 |
dance | 33 | |
AAA | 44 | |
BBB | Youth | 12 |
bachelor | 45 | |
BBB | 66 |
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 name | Event name | Event id | Parent Event Id |
AAA | cultural | 22 | 44 |
dance | 33 | ||
AAA | 44 | ||
BBB | Youth | 12 | 66 |
bachelor | 45 | ||
BBB | 66 |
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You want to do this in the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
Thanks,
Mohammed Mukram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes Bro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess we already have two script based solution listed by @Saravanan_Desingh and @mdmukramali . Have you checked those out yet?