Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vicente89
Contributor II
Contributor II

Filter by initial and final word

Hello, I have a problem.

I need data for certain routes whose origin is MAD and destinations are: LPA TFN/TCI FUE ALC PMI MAH AGP PUJ HAV CUN SDQ.

I have a 'routing' filter in which I can filter by routes.
The problem is that many routes make stopovers and those stopover airports leave in the middle of the route.
Example: MAD-ALC, ALC-AGP, AGP-HAV.
What I want is that it filters me only for the ones that start with MAD and end with one of those 12 destinations.

In other occasions, I have used the regular expression *MAD*, which filters everything that contains the word MAD, but I can't find any regular expression that does the same but when it is only the first word; nor when it is the last one, to put the destinations.

ChatGPT tells me that to make it the first word MAD, I have to put ^MAD*, but I have tried it and it doesn't show me anything.

I do not have access to the script editor.

Does anyone know how to do it?

Thank you very much in advance.

 

23 Replies
Happy_Mask_Salesman
Partner - Contributor III
Partner - Contributor III

You want to get also the stopovers too?

If I understood well, you would only have to filter by this:

*- MAD",*

Notice, all the characters before - MAD", (including comma and double quotes).

Happy_Mask_Salesman_3-1697649640206.png

Now you can know the origin, destination, and stopovers.

Is this what are you looking for? If not, play add and removing the double quotes (""), brackets ({}) and the commas (,).

 

Regards,

 

 

vicente89
Contributor II
Contributor II
Author

The scales do not matter to me (I want that it does not take into account the scales that have that and only looks at the first and last word), I want to know the first word (origin) MAD and the last word ALC for example, but so with several.

How would be the formula so that for example it would take the routes that are first word MAD and last word is: ALC and another first word MAD and last word AGP?
Would it be possible that in the same formula I get several?
Greetings.

 

vicente89
Contributor II
Contributor II
Author

I have seen that if I put: {"MAD**ALC"}, it takes me what I want which is that origin is MAD and destination ALC, regardless of the scales, but what I want is that apart from that route it takes me several more.
How do I do so that in the same search engine of the filter I can put more than one route?
It should be something like: {"MAD**ALC"}, {"MAD**AGP"}, {"MAD**HAV"}
But this way it doesn't catch it, not even like this: {"MAD**ALC"}&{"MAD**AGP"}&{"MAD**HAV"}
Do you know how I could do it?

vincent_ardiet_
Specialist
Specialist

Could you illustrate with some examples what you have and what you expect to obtain?
It becomes less and less clear to me.

vicente89
Contributor II
Contributor II
Author

Tengo lo que muestro en las 3 primeras fotos. Es decir, de uno en uno me coge bien lo que quiero.
Pero quiero que me coja varias juntas. Como aparece aqui abajo

vicente89_0-1697700330470.png

 

vincent_ardiet_
Specialist
Specialist

I mean examples of something which would work, not example of what is not working.
Like:
{"MAD - TUN"} - No
{"MAD - LPA"} - Yes
{"MAD - LPA","LPA - TUN"} - ?
{"MAD - TUN","TUN - LPA"} - ?
{"MAD - TUN","TUN - LPA","LPA - BOG"} - ?
{"MAD - TUN","TUN - BOG","BOG - LPA"} - ?
...



vicente89
Contributor II
Contributor II
Author

It works for me:
{"MAD**ALC"} --> YES
{"MAD**AGP"} --> YES
{"MAD**HAV"} --> YES

I want it to take all 3 together, not separately:
{"MAD**ALC"}+{"MAD**AGP"}+{"MAD**HAV"}

It doesn't work for me:
{"MAD**ALC"},{"MAD**AGP"},{"MAD**HAV"}
{"MAD**ALC"}&{"MAD**AGP"}&{"MAD**HAV"}

vincent_ardiet_
Specialist
Specialist

WildMatch([Route],'{"MAD*') And WildMatch([Route],'*LPA"}','*TFN"}','*TCI"}','*FUE"}','*ALC"}','*PMI"}','*MAH"}','*AGP"}','*PUJ"}','*HAV"}','*CUN"}','*SDQ"}') 

Happy_Mask_Salesman
Partner - Contributor III
Partner - Contributor III

"
I want it to take all 3 together, not separately:
{"MAD**ALC"}+{"MAD**AGP"}+{"MAD**HAV"}

It doesn't work for me:
{"MAD**ALC"},{"MAD**AGP"},{"MAD**HAV"}
{"MAD**ALC"}&{"MAD**AGP"}&{"MAD**HAV"}

"

You want to select multiple sets of values, not only literal values as I finally understood.

This syntax should be enough by surrounding each search in this sintax:

("value"|"value"|"value")

Where "value" should be switched for {"MAD**ALC"} and etcetera.

Check this community post answered by @sunny_talwar :

https://community.qlik.com/t5/QlikView-App-Dev/Multiple-Wild-Card-searches/td-p/22483

You might have problems using this solution due the use of double quotes, as Qlik might get confused. Double quotes are to cut straight a search term, and you have some double quotes in your original values.

Test it out and tell us how it went.

Regards,

vicente89
Contributor II
Contributor II
Author

This way I see it works but I would like to do it in a search in the filters, not having to create a new measure.