Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

subset of a field for a filter or a calculaion

hey,

i have a large list of names in a field called NAME. and i want to select

only a subset for a calculation or for a filter or other things. for example

all names which began with A, D and S.

is it possible to solve this problem with a if-statement??

best regards, rico

1 Solution

Accepted Solutions
Not applicable
Author

If you want, for example, to create a new field with the first letter of the names in order to have it as a "filter" or use it as a Dimension in a chart or a table, you can do the following in the script:

LOAD

     Name,

     left(Name, 1) as First_Letter

FROM ....;

Then, you will be able to use the First_Letter field as a filter or in a chart / expression.

Hope it helps.

View solution in original post

5 Replies
robert_mika
Master III
Master III

maybe like this:

=if(Left(Names,1)='A' OR Left(Names,1)='D' OR Left(Names,1)='S',Names,)

maxgro
MVP
MVP

load

     NAME,

     if(WildMatch(NAME, 'A*','B*','C*'), 'match', 'nomatch') as match_nomatch,

     .............

from

     sometable

where

     WildMatch(NAME, 'A*','B*','C*')

     ;

Not applicable
Author

If you want, for example, to create a new field with the first letter of the names in order to have it as a "filter" or use it as a Dimension in a chart or a table, you can do the following in the script:

LOAD

     Name,

     left(Name, 1) as First_Letter

FROM ....;

Then, you will be able to use the First_Letter field as a filter or in a chart / expression.

Hope it helps.

Not applicable
Author

thank at all. the problem is solved

Not applicable
Author

I'm glad you solved it.

Please mark the correct and helpful replies so others can benefit from the questions and answers in this thread.