Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nickmarlborough
Contributor III
Contributor III

Creation of New Columns depending on the value of a column

Hello,

Currently i have a table as such:

Type Type ID
Medical 123
Medical 126
Vehicle ABC
Medical 127

 

What i would like....

Type Med ID Vehicle ID
Medical 123  
Medical 126  
Vehicle   ABC
Medical 127  

 

how does one do this?

Labels (1)
4 Replies
BrunPierre
Partner - Master
Partner - Master

If(IsNum([Type ID]), [Type ID],Null()) as "Med ID"

If(IsText([Type ID]), [Type ID],Null()) as "Vehicle ID"

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

A generic 🙂 approach that can handle multiple Types is 

Data:
Generic
LOAD Type, Type & ' ID', [Type ID]
Inline [
Type, Type ID
Medical, 123
Medical, 126
Vehicle, ABC
Medical, 127
];

rwunderlich_0-1711467305279.png

 

See https://qlikviewcookbook.com/2010/05/use-cases-for-generic-load/

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

 

nickmarlborough
Contributor III
Contributor III
Author

didnt seem to work... just gave me a column name called [Type] ID rather than 'Medical ID' or Vehicle ID

 

am i makiing an error?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm guessing your error is that you are using single quotes around the [Type] field name. It should be unquoted. Can you post your Generic Load statement?

-Rob