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

Limit dimension values in list box

Hi,

I want a listbox in my QV Model however I only want the selection for those employees that have created a new product in the last 90 days not everybody. 

I don't know if I'm on the right line below - as yet it doesn't appear to work.

=if(count({$<CreationDate ={">$(v90days)"}>} CreationDate)<>0, EmployeeName, null())

Many thanks

C

1 Solution

Accepted Solutions
Not applicable
Author

HI Chirag

create a variable to hold the date for v90days: =date(floor(today()-90))

then in the list box that holds the employee name write the below as an expression in the field under the tab General

=if(created ate>=v90days,employeename)

thanks and regards

padma

View solution in original post

5 Replies
Not applicable
Author

Hi Chirag

i guess $(v90Days) id a date like today()-90

Date format can be different between CreationDate and $(v90Days). It then gives no result

second is {$<CreationDate =....

$ means set analysis will be based on the current selection. It might be what you want. If you want to check on the whole set of data reaplce it by 1

best regards

Chris

sasikanth
Master
Master


hi

can you let me know what you are using in v90days variable

Not applicable
Author

HI Chirag

create a variable to hold the date for v90days: =date(floor(today()-90))

then in the list box that holds the employee name write the below as an expression in the field under the tab General

=if(created ate>=v90days,employeename)

thanks and regards

padma

Not applicable
Author

Hi Chirag, Please use the below expression:

IF(CreationDate >= Floor(today() - 90) , EmployeeName)

It will work eventhough your CreationDate is any format it will work.

If you have more data, then Create the Flag in the Script level and use the Flag in the List box expression.

Script:

LOAD *,

     IF(CreationDate >= Floor(Today()-90) , 1,0) AS 90DAYFLAG

From EmplyeeDetail.qvd (qvd) ;

LB Expression:

IF(90DAYFLAG, EmployeeName)

Not applicable
Author

Thanks for that; funnily enough after taking a step back and simplifying what I was doing I came up with the same solution - =IF(CreationDate >= v90days, EmployeeName, NULL()).   Is there any benefit using the NULL()?

I'm actually going to make the variable dynamic in that the user will be able to set it to 30 days, 60 days or 90 days using a slider. 

Thanks for your help again.