Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

creating flag for a dataset

Hi all,

I'm trying to create a flag to my following sample data set.

  

IDName
A100_2000
B32498762134_43874
C46387_47398
D12
E20

In my Name filed, '_' separates the values.

I'm trying to create a flag for IDs A,B, and C as it has 2 values.

can someone please help?

Any help is highly appreciated.

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

like this?

Test:

LOAD * Inline

[

ID,Name

A,100_2000

B,32498762134_43874

C,46387_47398

D,12

E,20

];

NoConcatenate

Test2:

LOAD 

ID,

if(index(Name,'_')>0,1,0)as Flag

Resident Test;

DROP Table Test;

View solution in original post

2 Replies
robert_mika
Master III
Master III

like this?

Test:

LOAD * Inline

[

ID,Name

A,100_2000

B,32498762134_43874

C,46387_47398

D,12

E,20

];

NoConcatenate

Test2:

LOAD 

ID,

if(index(Name,'_')>0,1,0)as Flag

Resident Test;

DROP Table Test;

markgraham123
Specialist
Specialist
Author

Thanks a lot Robert!