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

Question on selecting data corresponding to a set of values

Dear Community,

I have a similar question as described in Searching for multiple values | Qlik Community.


In specific, I have a huge data set, where I would like to select the data, if one field (e.g. test code) is in certain set of codes (about 10 codes among >100). I think it corresponds to the question above, but I cannot open the answer unfortunately.

Can anybody suggest a suitable solution - also from performance point of view-, explaining explicitly please ?

Thank You very much,

Zeynep

4 Replies
Miguel_Angel_Baeyens

Hey Zeynep,

The link is missing but we'll try to recover it.

However, what you want is to automatically build a set analysis syntax provided several random values so the expression selects within those values?

Can you please use a dummy example on what you want to achieve?

Miguel

Not applicable
Author

Hey Miguel,

Thank You for the reply ! Sorry if the link is not working. It was thread 17077, question was raised by tresesco in 2011 with the header "Searching for Multiple Values" and you have replied him actually

Let me give a dummy example as the following :

Lets assume I have data from more than 150 countries, which are not clustered, just listed down. Data includes more breakdown per country, such as (1) population (2) annual growth and so on in the columns.

What I would like to do is : to create a group e.g. Europe for the data, selecting only 28 countries.

So the data would be presented for Europe, but I still would like to be able to select data per country in Europe, so country dimension would be preserved.

I managed to create a button with action "Toggle Select"  by defining country in the "Field" and explicitly listing down the name of the countries in "Search String" in the format of e.g. (Germany|Netherlands|France|....). It works OK (note: now working on how to change colors when button is activated). Yet, I am looking for somehow more subtle way to do it, instead of typing 28 country name in the Button's Search String. Thought of creating a table in edit script and mapping the data. I managed also to create a new table in edit script by "Load * Inline", but I am not sure how to proceed from there, assuming ApplyMap would not give the right solution (?), as I do not want to map the whole data actually, but to select part of it according to my new table. I am wondering both how to do it and how to use "Set analysis" as you mentioned.

I am not sure also what would be the best way for better performance either. Right now in my data set, there are bit less than 30 000 lines. Yet this can be more than 200 000 lines in the next data set, which will make me think about performance improvement.

Thank you very much for all the hints and tips. It is wonderful to have the opportunity to ask and get supported !!

Zeynep

Miguel_Angel_Baeyens

Hi Zeynep,

  • In regards to changing button color, see attached a very dummy example using variables and conditionals.
  • In regards to chains of values, that is correct if you want to use buttons and actions, specifying a string separated by "|". However, you can also use Bookmarks to store values and use them in your charts. See attached app in this thread that uses bookmarks in each sheet: not exactly what you are after, but it can give you an idea.
  • In regards to dynamically create groups in the UI based on actual values from the datamodel, check Alternate States and how they work in this app that you can download, in tabs "Product Grouping" and "Sales Overlap". This is likely what can help you most.
  • In terms of performance, you should not experience any issues with that volumes when it comes to number of rows. Obviously, if the analysis in the charts are very complex (several lines expressions and conditional expressions) that could affect.

Miguel

Not applicable
Author

Hi Miguel,

Thank You very much !! The application you have referred is very interesting, I will continue to explore it.

I may need the usage of bookmarks in every sheet later on, very good to know.

Zeynep