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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Protoss
Contributor
Contributor

Find similar words in dimensions

Hi everyone!
I was wondering is the any function  to find similar words in dimension?
what I  actually mean:
1. Type (dimension)    2. Category (dimension)                               3. Gross (measure)
elf _event                                main_elf                                                           100$
elf_event                                  main_orc           (don't need)                     50$  
elf_event                                   main_tank           (don't need)                 10$
As you see I need only that category where matches  "elf", and don't need any other
I can just write condiion like : if(category like '*elf*', category) etc.
But the main idea that after time type changes and it can be like ORC:
         1. Type (dimension)    2. Category (dimension)                            3. Gross (measure)
orc_event                               main_elf         (don't need)                           100$
orc_event                               main_orc                                                            50$
orc_event                               main_tank         (don't need)                        10$            
And here i don't need category elf or tank.

What I would like that the function what find same words like :
if word after first symbol '_'  from type   in  category, choose this type           
Result that I am expecting :
   1. Type (dimension)    2. Category (dimension)                            3. Gross (measure)
orc_event                               main_orc                                                            50$

OR if at this time another event
   1. Type (dimension)    2. Category (dimension)                            3. Gross (measure)
elf_event                               main_elf                                                           100$
                           

4 Replies
marcus_sommer

You may add a flag to your load or filter the loads with it directly, like:

-(subfield(Type, '_', 1)=subfield(Category, '_', 2)) as Flag

- Marcus

Protoss
Contributor
Contributor
Author

@marcus_sommer  Thank you for your answer! But could I search not the specific position in category field '2'? I mean actually I don't know where key word will be placed in category : main_elf(2) or elf_main(1) or new_main_elf(3). There is only key word elf and doen't matter where it is. Something like:
if(subfield(type, '_', 1)=subfield(Category, '_'), type)

JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @Protoss ,

You can use the like operator for this comparison:

Category like '*$(=subfield(type, '_', 1))*'

or even others:

WildMatch(Category, '*' & subfield(Type, '_', 1) & '*') = 1


Index(Category, subfield(Type, '_', 1)) > 0

JG

Protoss
Contributor
Contributor
Author

@JuanGerardo Hi Juan!
Thanks a lot! It is really useful!