Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

mwallman
Contributor

Script question: How to create a field with values based on another field in the same table?

Hello,

I have the following field:

Country:

Australia

Brazil

China

France

UK

US

From the country field above I want to create a Country2 field.

Country2 field values should be:

Australia

UK

US

How can I create this field most efficiently please in the script?

4 Replies
YoussefBelloum
Esteemed Contributor

Re: Script question: How to create a field with values based on another field in the same table?

Hi,

ok for the second field Country2, but the question here is how you want it to be linked to the first field ?

mwallman
Contributor

Re: Script question: How to create a field with values based on another field in the same table?

Hi,

Both of the fields will be in the same table.

I just want Australia, UK, US for Country2 if they are present in the Country field.

Re: Script question: How to create a field with values based on another field in the same table?

why?

binujose1982
New Contributor III

Re: Script question: How to create a field with values based on another field in the same table?

Hi Michael,

I think its possible with If statement,but you may need to hard code the country name.

If (Country = 'UK' or Country = 'US' or Country = 'Australia',Country) as Country2

Regards,

Binu

Community Browser