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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

condition problem

i have locations V800 to V899. i want to write a IF statement to get  V800toV829 and V880 to V899 as locations. my column name is "loc". how should I do this?

5 Replies
jsingh71
Partner - Specialist
Partner - Specialist

You can do like this

  If(PurgeChar(loc,'V') >=800 and PurgeChar(loc,'V') <=829, <Any Expression or Dimension>)

Not applicable
Author

Hi,

Try this script

Tbl1:
Load
Location,
KeepChar(Location,'0,1,2,3,4,5,6,7,8,9') as NumLocation,
From a.qvd;

Tbl2:
Load *,
IF(NumLocation,>=1 and NumLocation,<=10,'Location1','Location2') as NewLocation,

Resident Tbl1;

Drop Table Tbl1;

Regards

Kumar

its_anandrjs
Champion III
Champion III

Hi,

From your condition you want to get fields or want to get the values only let me know.

Thanks & Regards

Not applicable
Author

i want to get values

its_anandrjs
Champion III
Champion III

Hi,

Write a code for load statement some thing like this

Temp:

LOAD

    loc

from your location;

Data:

load

*,

if(right(loc,3) >= 800 and right(loc,3) <= 829, loc) as Condition1,

if(right(loc,3) >= 880 and right(loc,3) <= 899, loc) as Condition2

Resident Temp;

DROP Table Temp;