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: 
Not applicable

Input Box with Constraints from data column

Hi I'd like to add on an input box constraints from my data values (InsertDate column) is that possible?

I'm using constraints for empty and dates less or equal to today with:

len(date(date#($))) > 0 AND date#($) <= Today()

Thats my data example:

LOAD

     Customer,

     Category,

     date(InsertDate) as InsertDate

FROM

$(vPath)xsData.qvd

6 Replies
Carlos_Reyes
Partner - Specialist
Partner - Specialist

What are you exactly trying to do with the input box?

I would suggest to load an island date field that has all the valid values you need.

Not applicable
Author

The input box is used for a date filter. It is date format. I'd like to restrict inputs to dates that exists in my data table (InsertDate field). Is this possible through constraints?

Something like:

$(=Count({$<InsertDate = {">= ...... <=......."}>} InsertDate)) > 0

israrkhan
Specialist II
Specialist II

Hi, Use Min and Max Functions like below, make correction in the syntax.

and make sure your entered date format should be same format as you have in date fiels.

or use variables for min and max date, and the use those variable in conditions...

$(=Count({$<InsertDate = {">= $(=Min(InsertDate) , <= $(=Max(InsertDate)"}>})

tresesco
MVP
MVP

Try using Concat() function like:

Predefined Values->Listed Values

Expression:

=Concat({$<InsertDate = {">= ...... <=......."}>} InsertDate, ' ; ')

a_mullick
Creator III
Creator III

Hi,

I've got a possible solution for you. To constrain a varaible against a predefined list means defining some values like:

'a'; 'b'; 'c'

So what I've done is load a quoted version of the InsertDate (referred to as DropDownDate in the script) which can be used to build such a string. Another option though (unless you really need to store the date in a variable) is to use a calandar object. See the attached qvw

Not applicable
Author

I'm asking about the current inserted (by user) date on a custom "input constraint". I want to accept only dates that exists on data.

an example that works with variable is: $(=Count({$<InsertDate= {"<=$(vDateIns)>=$(vDateIns)"}>} InsertDate))

i want to instead of a variable to check the inserted by user date and if it has count number >0 to accept the date, else i display the error message like one other constraint i have: date#($) <= Today()