Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

create a new column by combining values from an existing column

Hi,

I have an existing column Portfolio with values 'APPS', 'BPO', and 'ITO'. I want to create a new column GBU with values 'ABS' and 'ITO' where 'ABS' is 'APPS' and 'BPO' from the first column.

PortfolioGBU
ITOITO
APPSABS
BPO

I have tried:

Load

..

..

Portfolio,

if(Portfolio='ITO','ITO') and if(Portfolio='APPS','ABS') and if(Portfolio='BPO','ABS') as GBU

..

From

but it's not working for me

Please help!

1 Solution

Accepted Solutions
ecolomer
Honored Contributor II

Re: create a new column by combining values from an existing column

Try this:

if(Portfolio='ITO', 'ITO', if(Portfolio='APPS', 'ABS', if(Portfolio='BPO', 'XXX', 'YYY'))) as GBU

3 Replies
ecolomer
Honored Contributor II

Re: create a new column by combining values from an existing column

Try this:

if(Portfolio='ITO', 'ITO', if(Portfolio='APPS', 'ABS', if(Portfolio='BPO', 'XXX', 'YYY'))) as GBU

Not applicable

Re: create a new column by combining values from an existing column

Geez, it's always the simplest way isn't it!! Thanks Enrique.

Do nested if statements work as expressions in charts? I seem to remember having trouble using them there which is why I didn't think to use it in the Load statement.

ecolomer
Honored Contributor II

Re: create a new column by combining values from an existing column

No, you use this in both, graphics and script

TX

Community Browser