Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a qlikview tool that allows the user to search by either "Account Name" or "Account ID".
The amount of data has gotten to the point, that I want to make sure that always 1 is selected (either or/ or both).
When I make "Account Name" always 1 selected. Then you can no longer search on Account ID, any value that comes up is greyed out, and when selected, it doesn't overwrite current value. And vice versa with "Account ID"
For instance (see attached example)
Account Name = Beth is selected, which corresponds with account ID = 2.
Account Name is a "always one value selected field"
If someone searches for account ID = 6 (which is frank) I want them to be able to select it, and have it choose frank automatically.
Thanks for your help in advance!
how did you clear all filters?
the triggers replace the "always one....."
"always one....": I suppose you can't have account id and name both with "always one...." checked
my 2 ideas were
- trigger
- replacing the 2 fields with a AccountID & '-' & AccountName
not discouraging but triggers would be last thing i will choose to fix any issue, because it causes unnecessary issues.
Check now pls.
But sometimes you have to rely on triggers to fix issues. I think it depends on the complexity of the issue and whether you have any other option available. In our company we are working on complex disjoint datasets which we have to link together and the only option we have is to send triggers back and forth and we do use some very complicated triggers .They work well. In my opinion as long you understand the triggers well, it should work as it is supposed to.
agreed, just saying if there is other solution available why triggers.
that trigger solution might cause issue when you have other field (accountAddress) in the same account table and do select / unselect accountAddress will clear account name.
In thecondition you have given above, the below attachment should work. There is only one trigger her "On any select" and it always goes back to Account Name no matter what you selected and cleared.
The logic is if there is nothing selected at all then it defaults to accountname. Even if u have another field eg:accountaddress and you do a select on that and then you unselect it, it goes back to the accountname.
this one is better.
Hi, that seemed to work, but then I encountered a problem. (in real tool)
I removed the "Always Select One" checkbox and added the trigger function.
I attempted to "clear all" and it worked and went to my default selected account.
However, when I then searched for a new account, it froze up the entire tool.
It behaved the way it would, if no account was selected.
With the "Always Select One" box checked, it does not ever "freeze up".
That is wierd. I have used more complex trigger with a big dataset and it never happened. How big is your file?
There is a more simple way to do the same thing, but not sure if u r looking for more functionality with it. Select a default accountname and then on the clear button make it "Set clear state". No matter what u choose when u clear it , it always sets it back to that default accountname. Let me know if this helps.
Hello again, and thank you for all your help.
I think the latest solution with a "set clear state" might be the simplest and therefore most elegant solution. They still can accidentally remove the filter (by using eraser on account name, or clicking the highlighted account name), which will cause the tool to freeze, but I will reinforce in training that they should not...
This will also allow them to select multiple Accounts at once, which is something they were hoping to be able to do.
Thanks!