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

Populate drop down input box with DB field values?

I want to set up a drop down input box on a report for a customer to select an available sales date from the database where I want the value of each available date in the database to appear in the drop down selector as one per row.

On the constraints tab I have the following setup:

Input Constraints = Predefined Values Only -- nothing else is selected or checked.

Value List = Predefined Values in Drop-down -- nothing else is selected or checked.

Predefined Values has the listed box checked with the following formula (-- nothing else is selected or checked):

=Concat( {1} DISTINCT SALES_DATE, chr(10) & chr(13) , SALES_DATE )

This doesn't work and wants to give a linear list of the SALES_DATE field. I want the list to place one date per line of the drop down input box.

Any help?

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

There is an oddity with QlikView for some users that semicolon will not work for this drop-down. They seem to have to use comma instead. Could you please try that to see if it works for you?

View solution in original post

10 Replies
Digvijay_Singh

You can use list box of required date field to have desired drop down of date since your purpose is to select date from drop down, right?

Not applicable
Author

I am looking to set a start-sale-date and end-sale-date variables that would be used to show only the data between the date range. I want the SALE_DATE from the DB to populate the drop down of the input box field.

petter
Partner - Champion III
Partner - Champion III

You should use the semicolon as separator - QlikView will put all the values on separate lines for you in the drop-down. So replace the Chr(10) & Chr(13) with ;

Not applicable
Author

I tried that and it ran all of the dates together on one line with them being separated by a semicolon when using: =Concat( {1} DISTINCT SALES_DATE, ';' , SALES_DATE )

petter
Partner - Champion III
Partner - Champion III

There is an oddity with QlikView for some users that semicolon will not work for this drop-down. They seem to have to use comma instead. Could you please try that to see if it works for you?

Not applicable
Author

That worked! Thank you for the help!

Not applicable
Author

Do you know how to get it to stop sorting the data when I use it for a 'Month & Year' string in the same formula?  =Concat( {1} DISTINCT (Month(THE_DATE) & ' ' & Year(THE_DATE) ), ',' , (Month(THE_DATE) & ' ' & Year(THE_DATE) ))

petter
Partner - Champion III
Partner - Champion III

The last parameter is how QlikView's Concatenate()-function should sort the data:

      ( Month(THE_DATE) & ' ' & Year(THE_DATE) )

It doesn't seem like that is how you want to sort it - does it? I would guess that THE_DATE alone or -THE_DATE (for descending dates) alone should be the sort order you want.

Not applicable
Author

Thank-you! Using THE_DATE as the sort parameter worked!