Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Input Boxes

Hi All,

I am relatively new to Qlickview but really appreciating the power it gives but I have a couple of issues with some input boxes that i need to solve before I can call my first report finished. I have searched the forums but couldnt specifically find anything on this...

I have an input box that has 2 fields linked to variables for setting a range for Start Date and End Date for the report.

First Issue

The date filter is only taking effect after doing a Page Reload or Partial Reload. I would have hoped the filter kicks in straight away as the logic is in the action onChange event for the variable. Is there a way to make this take effect without having to reload?

Second Issue

I have implemented a Clear All Selections Button on the sheet. As expected this clears the date filtering. But i would also like to empty the dates that have been entrered into the input boxes. I found a script called input_clr. This inserts an empty string into the box (and variables) but this then still leaves a filter, because the search string has a less than or greater than symbol and the clearing of the input boxes is triggering the onEdit action of the input boxes again.

I hope these points make sense. Does anybody have any advice?

Regards.

Richard

7 Replies
Not applicable
Author

First issue

That your date range changes don't take effect until a reload implies to me that you are setting the date or at least gaining the filters from the load script or VB, which may be over complicating the issue.

Also in my expreince, having start and end dates gets a bit cumbersome when building the data model, you often need two master calenders (one for starts and one for stops) , the great thing about qlikview is that you can shift click or ctrl click ranges or even just drag a box round dimensions in most tables, charts and list boxes or even use the calender slider meaning you only need a "date" field and one connection between the tables, but thats just personal preferences, horses for courses and all that.

Set two variables, call them vStartDate and vEndDate and your input box is set to store the users date straight into them.

Create two buttons, one captioned "Apply Dates" and the other captioned "Clear Dates"

I'm going to assume you have two fields StartDate and EndDate

go to the properties of the "apply dates" box, then actions, add, selection, select in field, choose the field "StartDate" and in teh value box enter =vStartDate

clikc ok then add another select in field action, choose the field "EndDate" and in the value box enter =vEndtDate

go to the properties of the "clear dates" box, then actions, add, selection, select in field, choose the field "StartDate" and in the value box enter =Null()

click ok then add another select in field action, choose the field "EndDate" and in the value box enter =Null()

add a third action, this time go external, set variable, choose the vStartDate variable and value =Null()

finally add a fourth action, external, set variable, choose the vEndDate variable and value =Null()

Now, you can enter dates in the input box, clikc the "apply dates" and the date selection will change. click clear dates and the selctions for the dates (and not any other parameters) will be cleared, no relaods required

Not applicable
Author

hi there, for the second issue, the syntax for null has solved that problem, thanks! i am still stuggling with the first issue though. i will try to explain a bit more. it is a project based system so each project has a start and end date. what i need is to let the user decide the date range and then we need to filter to give projects that may have been active in that date range. so my actions are:

1) select in field

field: app.startDate

search string: = '<' & EndDateP

2) select in field

field: app.endDate

search string: = '>' & StartDateP

Unforatunatly even though I have now put the actions on the button i still have to reload or partial reload before the filter applies. The table that app.startDate and app.endDate come from is saved and loaded from a .qvd files and there isnt any filtering applied in the script

Why do you think it is still needing a reload?

Regards,

Richard

Not applicable
Author

On first glance it would suggest that EndDateP and StartDateP are being set in the load script through a "LET" or "SET" command.

Do your input boxes in the sheet defiantly store straight into EndDateP and StartDateP or are you performing a function on them first?

Create a text box that has "=EndDateP" as the expression and whatch how it reacts to data being entered. In normal operation, as soon as you press enter on the input box the textbox shoudl update.

Alos, are you using EndDateP and StartDateP to limit any data laods e.g. in the script are there any commands like

Load x,y,z from data.qvd where x < EndDateP;

If you limit the data in teh laod then any changes won't take effect till you reload.

Not applicable
Author

hi there,

thanks for suggesting these things, unfortunatly none are the culprit, the variables aren't set or let in the script and there is no data filtering in the script and when i display the variable in a text or input box it is storing the value straight away as you would expect.

the only thing that is happening in the script apart from loading the data are some left joins

it sounds like this behavior is not as you would expect. are there any qlickview specific things i can try to diagnose what might be going wrong?

Regards,

Richard

Not applicable
Author

Only other thing i can think of is maybe its a bug in an older version of QV as i tried to replicate the issue in a local copy but it worked as expected, try using the most up todate release (v9 SR5 i believe) if you are not on that already.

Not applicable
Author

thanks - i will try this

regards,

richard

RickWild64
Partner - Creator
Partner - Creator

I had a similar problem. I found that the select worked only the first time after changing the button properties.

Works fine in v10 SR1