Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
satheshreddy
Creator III
Creator III

one small scenario ?

hi experts,

  i have small requirement

i have 2 list boxes these 2 list boxes having Date fields with same data,

my requirement is if select one date in one field at that time 2nd field to display


current selections>dates


any one explain using set analysis.



thanks

s reddy

7 Replies
sunny_talwar

Using triggers and alternate state, you might be able to get what you want. I have sample for you to look at.

Capture.PNG

HTH

Best,

Sunny

MK_QSL
MVP
MVP

PFA

Edit: little correction in trigger

maxgro
MVP
MVP

maybe with a trigger, see attachment

satheshreddy
Creator III
Creator III
Author

hi sunindia,

please explain step bye step  because am learner so if you possible let me explain.

thanks

s reddy

sunny_talwar

1. Script (Courtesy Manish‌)

Table:

LOAD Date(Floor(Rand() * 365 + Today())) as Date

AutoGenerate 10000;

2. Created a list box for Date

3. Created a alternate state from document properties

Capture.PNG

4. Created a second list box in alternate state using an expression

Capture.PNG

5) Created a trigger which sets the vMaxDate's value = Max(Date)

Capture.PNG

and TAAAAADAAAA you are good to go...

HTH

Best,

Sunny

satheshreddy
Creator III
Creator III
Author

hi,

please tell me a little correction on trigger, my qlikview is personal edition please write the correction.

thanks

s reddy 

MK_QSL
MVP
MVP

Use below in your script.

===============================================================

LOAD

  Date(Today() + Floor(RAND()*(AddYears(Today(),1) - Today() + 1))) as InvoiceDate

AutoGenerate 1000;

LOAD

  Date(Today() + Floor(RAND()*(AddYears(Today(),1) - Today() + 1))) as Date

AutoGenerate 1000;

===============================================================

Now consider that you have two list boxes.. one for Date and 2nd for InvoiceDate.

Date list box is straight forward but any date you change/select in Date list box will give InvoiceDate accordingly.

InvoiceDate automatically get selected which are greater than Date which is selected.

Follow below steps to get this result.

Create two list box

1) Date

1) InvoiceDate

Go to Settings -- Document Properties -- Triggers -- Field Event Triggers

Select Date -- On Select ---

Add

Field

InvoiceDate

Add

Select in Field

Field

InvoiceDate

Search String

='=InvoiceDate>=Date'

Same action add for onChange trigger on Date field.

Hope this helps..