Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
tom2qlik
Contributor

Merge one field into another

Hi all,

I am trying to move values from one field into another.  Currently I have my dataset looking like below:

This table is created by left joining on number with the pulling field being location2.

I want to move the values from location2 into the location field.  

   

NumberPalletLocationLocation2
11aaaLondon
11aabLondon
11aabLondon
2 Paris
22fbb Paris
22fbb Paris
22fbb Paris
33SabMadrid
33SadMadrid

Thanks,

Tom

1 Solution

Accepted Solutions
paridhimantri
Contributor

Re: Merge one field into another

Hi,

This will give you required output.

LOAD Number,

     Pallet,

     if(isnull(Location),Location2,Location) as  Location,

     Location2

FROM

(ooxml, embedded labels, table is Sheet1);

Thanks

Paridhi

3 Replies
paridhimantri
Contributor

Re: Merge one field into another

Hi,

This will give you required output.

LOAD Number,

     Pallet,

     if(isnull(Location),Location2,Location) as  Location,

     Location2

FROM

(ooxml, embedded labels, table is Sheet1);

Thanks

Paridhi

prma7799
Honored Contributor III

Re: Merge one field into another

Try this....

Test:

LOAD * Inline [

Number ,Pallet,Location, Location2

1 ,1aaa ,London ,

1 ,1aab ,London ,

1 ,1aab ,London ,

2 , , ,Paris

2 ,2fbb , ,Paris

2 ,2fbb , ,Paris

2 ,2fbb , ,Paris

3 ,3Sab ,Madrid ,

3 ,3Sad ,Madrid ,

]

;

TestNew:

LOAD Number ,Pallet

,

if( len(trim(Location))= 0 , Location2 ,Location ) as NewLoc

Resident Test ;

drop Table Test;

Re: Merge one field into another

If only one or the other will ever have a value, you can just do this

Location & Location2 as Location