Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Pomna
Creator III
Creator III

Filtering Data

I have a Dimension called ProjectCodes with the following codes for example 

ISPC0003

ISPC006

SODC0987

ERTD9865

ISKD987

ISKO9345

ISPI8745

ISPI294

SODG646

GRTE7646

DHIJ8736

ISCOME7635

I would like to create a flag or a new dimension using all codes which start with ISPC and ISPI  so that I would be able to filter the data. Any suggestions on how to go about that would be appreciated.

3 Replies
Chanty4u
MVP
MVP

Try this:

ab:
load *,
if(WildMatch(MyData,'*IS*'),'IS','NonIS') as flag ;
load * Inline [
MyData
ISPC0003

ISPC006

SODC0987

ERTD9865

ISKD987

ISKO9345

ISPI8745

ISPI294

SODG646

GRTE7646

DHIJ8736

ISCOME7635
];
exit SCRIPT;

 

IS.PNG

MayilVahanan

Hi @Pomna 

If you want start with ISPC & ISPI , then try like below

Load *, if(wildmatch(ProjectCodes , 'ISPC*', 'ISPI*'), 1, 0) as Flag from yoursource;

it will gives only the project code start with aboves.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Pomna
Creator III
Creator III
Author

Thanks for your response. I tried your suggestion and used the following set expression to retrieve the data 

count({<Project Flag={1}>} Project Code)

I get only numbers but what I need is a list of all codes that start wit h ISPC and ISPI