Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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

Re: subset of a field for a filter or a calculaion

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.

5 Replies

Re: subset of a field for a filter or a calculaion

maybe like this:

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

MVP
MVP

Re: subset of a field for a filter or a calculaion

load

     NAME,

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

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

from

     sometable

where

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

     ;

Not applicable

Re: subset of a field for a filter or a calculaion

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

Re: subset of a field for a filter or a calculaion

thank at all. the problem is solved

Not applicable

Re: subset of a field for a filter or a calculaion

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.