Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
RichardLinderman
Contributor II
Contributor II

New field based off numeric field using > and <

So I'm trying to create a new field based off a field I already have that measures days plane tickets were booked in advance. Said days field looks like this:

3

7

0

0

0

0

1

1

0

2

 

I want to make a field that classifies these as "0-4 days" or "5+ days". Can you help me?

Labels (2)
1 Solution

Accepted Solutions
Braveen
Contributor III
Contributor III

You can try this for backend script;

 


Data:
Load *,
if(Days >= 0 and Days <= 4, '0-4 days','5+ days') as category
;
Load * Inline [
Days
3
7
0
0
0
0
1
1
0
2
];

 

Output:

Braveen_1-1709813116159.png

 

Is this what you are looking for?

View solution in original post

2 Replies
Braveen
Contributor III
Contributor III

You can try this for backend script;

 


Data:
Load *,
if(Days >= 0 and Days <= 4, '0-4 days','5+ days') as category
;
Load * Inline [
Days
3
7
0
0
0
0
1
1
0
2
];

 

Output:

Braveen_1-1709813116159.png

 

Is this what you are looking for?

RichardLinderman
Contributor II
Contributor II
Author

Great! Thanks.