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

Variables and data range

I want to give the user the option to filter some rows according to non-defined constraints. Imagine you have 100 rows and 10 columns and you want to filter rows by giving a constraint to some columns. So in the table box I have the full table. I have to create as many list boxes as the filtering fields so that the user can write in the search something like >50<20. But this is not very user-friendly.

So I tried to do it with variables. I created an input box where you can write for instance min weight and max weight etc. In the variable event triggers I put in OnInput as a search string ='<'&[Max Weight] and for min the opposite. Is this the way to go or is there a better way?

I also encountered two problems. I cannot reset the variable values or delete with backspace. They keep the last value no matter what. I also had an issue when I have a single column (not two, a min.... and max....). If I create two triggers they don't work together to affect the column but only the last one is executed and the previous is erased. So I "solved" that by triggering a search >...AND <... but it will work only when you have given both variable values. I 'd rather keep the old trigger and the new would not replace the other but work on top.

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

I came up with a solution to reset the variables. You can use an Action "Set Variable" and give a NULL to the value. So you basically reset your variable (you can put a text or button "clear...."). This also solves the other problem because by assigning NULL you practically cancel any constraint.

But I would still like to know how you "hold on" and apply multiple filters one upon the other. For instance first set a min weight, get 70/100 results and then set a max and get 50/100 etc. Now I get the same results but in both cases I use > and <, but NULL cancels one of them until it gets a value.

View solution in original post

3 Replies
sujeetsingh
Master III
Master III

Hi,

I am pasting a sample may this give you any idea.

---Input box filters the Table rows

---RESET clear the filter

Not applicable
Author

Unfortunately I am currently using a personal edition until I see QV suits me for what I want. So I can't see any qvw files. How exactly do I reset the values in the input box as nulls (not the selections with clear)?

Not applicable
Author

I came up with a solution to reset the variables. You can use an Action "Set Variable" and give a NULL to the value. So you basically reset your variable (you can put a text or button "clear...."). This also solves the other problem because by assigning NULL you practically cancel any constraint.

But I would still like to know how you "hold on" and apply multiple filters one upon the other. For instance first set a min weight, get 70/100 results and then set a max and get 50/100 etc. Now I get the same results but in both cases I use > and <, but NULL cancels one of them until it gets a value.