Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

selection in a new field

Hi everyone,

I am a new Qlikview user.. And I need help...

I am trying to get the record which is bigger than for example 200 in a new field. How can I do this?

For example:


Person:

Load

ID,
Name,
Surname,
if(ID>100, 'under 30 year old', ... ) as Younger30; ----> here I want a new Field that shows under 30 years old people... with Name, ID etc.

SQL Select*
From Person;


Can anybody help me? I just wannt to have a new field with this selection, it is possible to do that?

1 Solution

Accepted Solutions
martin59
Specialist II
Specialist II

OK,

So you have to do something like this after your first load script :

Younger30:

LOAD

ID,

ID as IDYounger30,

Name as NameYounger30,

Surname as SurnameYounger30

RESIDENT Person

WHERE Younger30 = 'under30 year old';

Hope that helps you.

Martin

View solution in original post

5 Replies
martin59
Specialist II
Specialist II

Hi,

I'm not sure to understand what you want ?

did you mean :

if(ID>200, ID) as RecordBigger200 

Hope that helps you,

Martin

nagaiank
Specialist III
Specialist III

You are in the right track. The script, if I understand you correctly, will be:

Person:

Load ID,

     Name,
     Surname,
     if(ID>100, 'under 30 year old',if(ID>200,'60+,'Other')) as Younger30;

SQL Select*
From Person;

Not applicable
Author

First, Thank you for your help. I know how if - clause is working... Sorry, that I didn't explain correctly....

what I mean  is:

with the new selection... ( if then else) I would like to create in the table or in a new table a new field, which just shows the years under 30 years old.

martin59
Specialist II
Specialist II

OK,

So you have to do something like this after your first load script :

Younger30:

LOAD

ID,

ID as IDYounger30,

Name as NameYounger30,

Surname as SurnameYounger30

RESIDENT Person

WHERE Younger30 = 'under30 year old';

Hope that helps you.

Martin

Not applicable
Author

Thank you !!!!