Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select observations based on field variable

Dear All,

I'm struggling with this simple script:

//a day select for listbox

Day_select:
LOAD * INLINE [
Day_number
1
3
4
5
6
7
]
;


//Example from a large database
Table1:
LOAD * INLINE [
Day, Description, ID
1, Shutdown,1
1, Maintenance,2
2,Shutdown,3
3,Shutdown,4
5,Maintenance,5
6,Maintenance,6
7,Maintenance,7
1,No order,8
]
;


//Select the day
Table2:
NoConcatenate LOAD *
Resident Table1 where Day = $(eDay_number);

Drop table Table1;

What I would like to do:

QV.PNG.png

First: I have created Select your day Lost box.

After selecting a day, I press on the Reload button and the script will be reloaded.

Then I expect that the Table box contains observations with Day = 4.

I have defined eDay_number in the variable list that refers to name Day_number.

But I got an error...

Error.PNG.png

Why do I use this construction?

The database is quite large and need to select a certain day number to prevent too much re-loading time.

Could you please advice?

Thank you and best regards,

Cornelis

1 Solution

Accepted Solutions
janardhan
Creator
Creator

Hi , Please find the below attachement.

Hope this will helpss!!!!

View solution in original post

6 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

I think you can use a input box with a list of all your day number like this qvw

Regards,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
kedar_dandekar
Creator
Creator

Hi,

To filter data in the script you will need to use a variable.

The variable for the selected day-number selection can be set on using a Trigger (refer image below).

Refer attached QVW..

Trigger.PNG.png

HTH

Kedar

janardhan
Creator
Creator

Hi , Please find the below attachement.

Hope this will helpss!!!!

Not applicable
Author

That is a good starting point, you are right.

Thanks for it!

Best regards,

Cornelis

Not applicable
Author

Hello Janardhan,

Thank you for your reply, this is a to-the-point answer, it works.

When I have tried to reproduce your result, it does not work although the settings are exactly the same.

Does it depends on the Document properties, i.e. the aswer from KedarDan as described above?

Best regards,

Cornelis

Not applicable
Author

Hi Kedar,

Yes, that is very clear although not very easy to find.

The Trigger settings is key to make the event happen.

Using input box is not necessary because the list box provide the solution.

Thank you for your excellent answer, that is the best.

Regards,

Cornelis