Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Input box with Predefined values coming from a Field

Hi,

I can't seem to get this to work...

I just need an input box to set a value for a variable, but want to constain the possible values to what is stored in a particular field (a drop-down list would be the best).

Any pointers?

TIA

--

bob

19 Replies
pat_agen
Specialist
Specialist

hi,

create the input box. Go to the Properties->Constraints tab of the input box. Highlight yourfield. In t ebottom rght hand corner of the screen click on "predefined Values in Drop-down" and "Listed Values". In the Expression box under Listed Values enter an expresson such as this:

=concat(distinct YourFieldHere),';')

ListInInputBox.png

this will create a semi colon delimited list o fthe values form the field you wish to use. This is te format required for te contsraints in an input box.

try it and see.

Not applicable
Author

Hi,

I have tried this before...But the dropdown lists the values in a single row like Value1;Value2;Value3

Not applicable
Author

Almost!....

The problem is the values are text, and the requirement for text as listed values is that they must be enclosed by single quotes.

I tried using the string operator '&' with the chr(39) text function to add a single quote at the start & end of the expression, but that's still not enough, as it really needs the quotes surrounding the semicolon as well....

Miguel_Angel_Baeyens

Hi,

The above works fine here. What values are you using and what expression? Have you tried creating a new inputbox and not modifying the existing one?

Regards.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Hi Miguel,

Can you post the sample application for this

pat_agen
Specialist
Specialist

hi,

could you post an example?

just retested here and on a text field I did exactly as specified and it worked. Tried with another textfield having strings with spaces in them and it worked too.

I definitely don't think the semi colons [;] need placing inside quotes

from the help I can see this:

Listed Values

Check this alternative to specify a list of arbitrary predefined values. The values can be either numeric or alphanumeric. Alphanumeric values must be enclosed in quotes (e.g. 'abc' ). Each value is separated by a semicolon ( ; ) (e.g. 'abc';45;14.3;'xyz' ). This option can be used alone or in combination with Number series.

and I imagine thsi is what you are referring too. But I have the feeling the concat() expression gets around this.

I am missing something?

Not applicable
Author

pat.agen and Miguel,

The field that I want the predefined values holds dates in the format of YYYY-MM-DD, as follows:

TransactDatefield.jpg

The expression I used is therefore:

=concat(distinct TransacDate,';')

The result that I get is:

inputbox.jpg

pat_agen
Specialist
Specialist

hi,

then format it with Date()

=concat(distinct Date(Timestamp,'AAAA-MM-DD'),';')

Not applicable
Author

No joy....

I have tried

=concat(distinct date(TransacDate,'YYYY-MM-DD'),';')

and also

=concat(distinct date#(TransacDate,'YYYY-MM-DD'),';')

... the results are the same as depicted above.