Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
FMortensen
Contributor
Contributor

Showing selected field values in text box

I want to have a text box on the side showing which field values are currently selected and represented by the data in various charts. I have several filters for selecting various fields.

1. I want to build a text string of the fields selected. I would like at least 3 different fields to be listed, with the values of that field listed, in the text box (Country, Product and Year) as to build a sentence. I have succeeded in listing one field, but cannot get the two others to work in the same textbox. This is not a nested IF since I need the ELSE to be an option for all three IFs. Hence, I need to list 3 IF expressions that can all provide a list (if field is selected).

=If(GetSelectedCount([.Country])=0, 'All countries', GetFieldSelections([Country],', '))

2. The year is based on a date field Year([Date]) and I cannot make it work at all in the GetFieldSelections() function. Like the filter I only want the year and not the full date.

Any help is much appreciated!

Labels (1)
1 Solution

Accepted Solutions
Gui_Approbato
Creator III
Creator III

I believe all you have to do is to concat these expression using &.

So I would make like:

='Country: ' & If(GetSelectedCount([.Country])=0, 'All countries', GetFieldSelections([Country],', '))&chr(10)&

'Year: '&year(Date)

 

The "chr(10)" skips to a new line. The year(Date) will bring you the year of the selected date (or you can also create a column in the script with Year(Date) as Year.)

Is this what you are looking for?

View solution in original post

4 Replies
Gui_Approbato
Creator III
Creator III

I believe all you have to do is to concat these expression using &.

So I would make like:

='Country: ' & If(GetSelectedCount([.Country])=0, 'All countries', GetFieldSelections([Country],', '))&chr(10)&

'Year: '&year(Date)

 

The "chr(10)" skips to a new line. The year(Date) will bring you the year of the selected date (or you can also create a column in the script with Year(Date) as Year.)

Is this what you are looking for?

FMortensen
Contributor
Contributor
Author

This solved it! Great - Thanks!

Prithika
Contributor III
Contributor III

HELLO,

 i have a problem

if I selected a value in a field, the related field values(others) of the selected field should be displayed on the textbox.
 
for example:
student name: Harikrishna
 
student attendance status: present
 
student punch time: 8:00
 
if I selected Harikrishna in filter pane, in textbox it should show   attendance status , punch time without selection. is it possible?
Gui_Approbato
Creator III
Creator III

Hi Prithika,

You can create some IF there and use with the GetFieldSelection formula.

Take a look here:

https://help.qlik.com/en-US/sense/May2023/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunct...