Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get all the filtered item name into Text & image at Qlik Sense?

 

I have a column ‘myCountries’ containing different countries. I use ‘myCountries’ column as a filter dimension in Qlik Sense. I need to show which countries I select from ‘myCountries’ column in a Text & image part with Qlik Sense. If I put [myCountries] into the expression part of Text & image, when I select 1 country from ‘myCountries’ column, Text & image part will show the country name, but when I select more than 1 country from ‘myCountries’ column, Text & image part will show nothing.

Could you please give any suggestion?

Thanks!

 

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

A simple way to do this is to use the GetCurrentSelections() function in your expression. Here's an example that returns a list of products:

GetCurrentSelections (ProductName, 30)

By default this function returns 6 values, the parameter value 30 that I've used instead sets a limit of 30 values. You can also change the record, tag and value seperators.

View solution in original post

11 Replies
Anonymous
Not applicable
Author

Figure out a walking around solution: we can use CONCATENATE in Qlik to put the string together, and also use IF condition when it is necessary.

Anonymous
Not applicable
Author

A simple way to do this is to use the GetCurrentSelections() function in your expression. Here's an example that returns a list of products:

GetCurrentSelections (ProductName, 30)

By default this function returns 6 values, the parameter value 30 that I've used instead sets a limit of 30 values. You can also change the record, tag and value seperators.

Anonymous
Not applicable
Author

Rod, thanks so much for your help!

I table structure is: myState, myValue, myZipCode

I use myState and KML filet to create a map.

When I click one state one the map, I would like show information about ONLY the most recent selected state information with Qlik Text&image

When I use GetCurrentSelections (myState, 1), it still shows all the states that I have clicked. But I would like to show ONLY the most recent state that I clicked on the map.

Could you please give any suggestion?

Anonymous
Not applicable
Author

Rod, thanks so much for your help!

I created a US state map with Qlik Sense. When I click on the map, I would like to show some information about the state, and I would like to ONLY show one current selected state (previously selected state will be deselected).

I use US state name as the map dimension. When I use

GetCurrentSelections (StateName, 1) & 'other information'

in the text expression, it still does not work. (text part will show all states that I have clicked on the map, I only need 1 state that I currently clicked on the map)

Could you please give any suggestion?

Anonymous
Not applicable
Author

I don't think that there is a way to do that. If you have selected more than one state I don't believe there's a way to detect the order in which you selected them. The closest I can think of getting to your requirement is to include an "if" statement to detect how many states have been selected, then if the value is great than 1 display a message asking the user to please select a single state.

Anonymous
Not applicable
Author

here's an example of what I described above:

if(getselectedcount(ProductName)>1,'Please select only a single product', GetCurrentSelections (ProductName, 1))

Anonymous
Not applicable
Author

Rod, thanks so much for your help!

I tried this method before, and I use a IF condition to detect if more than 1 states on the map have been selected/clicked, the Text part shows "Please only select 1 state". But this does not meet the requirement.

We do not need to detect the order which states have been selected. When we use GetCurrentSelections, it will return state_recent_clicked, ....state_second_clicked, state_first_clicked. It seems a stack operation, so I tried to use Pick function, but it still does not work.

In Qlik Sense, when we prepare states map, we have to use states as dimension. However, when we click the map to select state, we can click state one by one, and then many states will selected, or have to hold Ctrl key to select ONLY one state, but this still is not intuitive. Other BI tools, such as Tableau, could do so.

Could you please give any more suggestion?

Thanks again!

Anonymous
Not applicable
Author

I was fairly certain that what I was suggesting wouldn't meet your exact requirement, as stated earlier I don't think there is a way to do it so I only offered it as a "next best possibility" option. I mentioned that there doesn't seem to be a way to detect the order in which values have been clicked because if there was we could easily pick it from the array returned by GetCurrentSelections. The order of the values in the array however seems instead to reflect the order of the values in the dimension or field.

By the way, I should have said to use GetFieldSelections instead of GetCurrentSelections it would be simpler. You can use it like this to get the last record selected:

     subfield(getfieldselections(myState,'#', 53), '#' , -1)

but it will only work if the selections made are in the order of the values in the field, which again won't work for you.

Sorry I don't have any other ideas at this time, my earlier suggestion is probably my best.

Anonymous
Not applicable
Author

Rod, thanks so much for your help!

Could you please explain the sytax below?

     subfield(getfieldselections(myState,'#', 53), '#' , -1)

what does '#', 53, and -1 mean?