Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
diwaskarki
Creator II
Creator II

separate two values in a field to rows for each value

I have a field called Owner that stores user ids like e1r1, mhtr, uert etc.

I am bringing this from a db2 field. Sometimes in each row there are multiple user ids separated by a comma.

I have another table called User_Info in qlikview, that stores first name, last name and user ids.

I need to correlate user ids from the Owner table to user ids in the USER_Info table but since there are more than one user ids in each row, I cant do that.

How do I separate user ids in the Owner table into a new row? Id appreciate the help.

2 Replies
eduardo_dimperio
Specialist II
Specialist II

Hi Diwas,

try this

LOAD SubField(Owner table , ';') AS new_ID

RESIDENT yourtable;

mikaelsc
Specialist
Specialist

the answer of Eduardo in combination with a crosstable() load statement

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptPrefixes...

this crosstable statement will allow you to crreate a table containing 1 row per user

once you left join this table back to the original table, this will duplicate rows (not magic, that's what a join does)