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

Create a new field with an a condition on other fields

Hello,

I am new to Qlik Sense and i am hoping that someone can please point me in the right direction. I have an excel file with two columns and i am trying to create a new field with a condition on the two fields.

My file looks like the picture below. I would like to add a new named Class Type based on the following conditions:

If Cabin=Coach then Economy

if Cabin= Not available then Not Recorded

if cabin =First or Spend<1000 then Economy

 

How can i please integrate this into my Script? Please help

Thanks in advance .

 

Tatiana

test.PNG

1 Solution

Accepted Solutions
ignacio_pena
Contributor III
Contributor III

Hi,

You can use the next expression in the script:

TEST:
LOAD Cabin,
Spend,
if(upper(Cabin) = 'COACH', 'Economy', IF (upper(Cabin) = 'NOT AVAILABLE', 'Not Recorded', if(upper(Cabin) = 'FIRST' or Spend < 1000, 'Economy', 'Not Type'))) as 'Class Type'
FROM
Test.xlsx
(ooxml, embedded labels, table is Hoja1);

Regards,

 

View solution in original post

3 Replies
joseph057292
Contributor
Contributor

Certification Coaching is a platform where professional discuss their successful experience in CompTIA Security A+ Certification to guide beginners. Discussion Leads to knowledge so this forum is basically providing knowledgable resources and guidance for its viewers.

ignacio_pena
Contributor III
Contributor III

Hi,

You can use the next expression in the script:

TEST:
LOAD Cabin,
Spend,
if(upper(Cabin) = 'COACH', 'Economy', IF (upper(Cabin) = 'NOT AVAILABLE', 'Not Recorded', if(upper(Cabin) = 'FIRST' or Spend < 1000, 'Economy', 'Not Type'))) as 'Class Type'
FROM
Test.xlsx
(ooxml, embedded labels, table is Hoja1);

Regards,

 

Tatynout
Contributor III
Contributor III
Author

Thank you it works!