Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

QV: Reflect single value in textbox

Dear all,

I am trying to create a textbox that reflects a single string value depending on the current selections and a formula integrated in the textbox itself.


Textbox currently contains the following query: =if([Event Year]=2017), 'Resort')

My Database is organized this way:

Event YearEventResortGame
2017

World Cup

A-CityGame 1
2017World CupA-CityGame 2
2016World CupB-CityGame 1
2016World CupC-CityGame 2
2017European CupD-CityGame 1
2016European CupE-CityGame 1


Now, as soon as the user filters to event "World Cup", the textbox should be able, with the help of the if-formula, to reflect the respective single value, as for 2017 there is only one distinct value in this column?

However in order that the formula correctly shows "A-City", I have to filter to Event year 2017 with the help of a listbox.

Does anybody see the mistake I am making, or the information I am missing?

Thanks a lot

Benedikt

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Try this in your text box:

= Concat(DISTINCT IF([Event Year] = '2017', Resort),  '|')

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

Try this in your text box:

= Concat(DISTINCT IF([Event Year] = '2017', Resort),  '|')

craigsutton
Creator
Creator

Not sure exactly how you wanted to see it, but here is a way to only show a value if a single event is selected:

=If(GetSelectedCount(Event)=1,Concat({<[Event Year]={2017}>} DISTINCT Resort)) 

Anonymous
Not applicable
Author

Thanks Craig and Vishwarath, both your options work fine and give the correct results.