Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to un-select values in a table

Hi all,

I hope someone out there has a sparkling idea as I am slowly going nuts...

I am trying to solve in issue in the area of cash matching:

I have a table that contains open transactions as well as unprocessed payments.  Each record set has a unique transaction number (besides a wide variety of other information).

The user needs to "match" open transactions to a particular open payment. When I say match, I mean that I want the user to create a kind of matching sheet that displays a number of transactions and an open cash item where the total amount equals "0" (that is the amount of transactions equals the amount of the cash item).

(I know this is not exactly what Qlikview was intended to do, but in this particular situation would by far be the best solution still)

I show all open items in a pivot table.

Now, what I want the user to do is to click on a transaction number to UN-SELECT the chosen transaction. This is repeated with other transaction numbers until only those transactions are left that match with an open payment in the list.

So , instead of the regular Qlikview behaviour (that is to set a filter on the particular transaction number I have clicked on) I need it to do the opposite (to un-select the chosen transaction number and show all transaction number except the one I have clicked on).

I know there is an inverse selection option in the menu, but as far as I can work it out, this will a) reverse all fitlers set and not only the one on transaction numbers, and b) cannot be used when the user needs to un-select multiple values of transaction number.

Also set analysis does not seem to be the answer, as after I have chosen one transaction number, I cannot proceed to choose a second or third one.

Does anybody have an idea how to solve this?

Many thanks in adance!!!

Thomas

18 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

I think my suggestion is slightly off actually.  Try setting the variable to be:

='(' & Concat(DISTINCT TxNumber_DI,'|') & ')'  NOTE: the "=" sign must be in your variable expression.

And get rid of the triger to change it.  Now change the expression in the button action to ="<> $(vExcludedIDs)"

See if that works...

By the way - you may need to add a preceding action in the button to clear the current selections for TxNumber

Not applicable
Author

Hi Jason,

that does not work: The variable does not store previously selected TxNumbers anymore and rather only stores the last selection...

Any idea?

(Thanks again for all the effort you put into this!!!!)

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Oops!  Forgot about the incremental selections...that'll teach me for breaking for lunch!

Go back to the previous solution with the trigger.  Set the trigger action to change vExcludedIDs to:

=IF(vExcludedIDs='',TxNumber_DI,vExcludedIDs & '|' & TxNumber_DI)

and put the button action back to ='(' & vExcludedIDs & ')'

Now, add another action to the same button of type Select Excluded and field TxNumbers.

Let me know...!

Not applicable
Author

Even closer!!!

It actually does what I need now, but...:

After I have executed the actions on my "Exclude TxNumbers"-Button, the Variable seems to loose its values - it shows "-" in my textfield afterwards!?!

I have no idea why its doing this, but it seems to be related to the "Select excluded" command - the same happens when I use the right click menu and choose select excluded...

I should mention that I had to put the expression on the "on selection" action of my TxNumber ID field - "on update" would not work.

Also I have slighty changed the expression to:

=If(%Key_OPs>0,(IF(vExcludedIDs='',%Key_OPs,vExcludedIDs & '|' & %Key_OPs)))

as this avoids getting any empty values between two pipes (what would happen i.e. if I un-select a value by clicking on it a second time.

If I can only save the values in my variable, I am there!?!

Maybe you have another of your sparkling ideas???

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Create a second variable vExcludedIDs_temp and add a new action before any of the others to copy vExcludedIDs over to this new one.  Then add a final action to copy it back again?

Not applicable
Author

That is exactly what I was trying already...

And yes, when I spread all actions over three buttons, it works perfectly.

Sadly, I do not seem to be able to actually apply all necessary steps to a trigger action:

1) trying to put all steps to the "on selection" trigger on my id fields does not work

2) trying to apply some actions on the "on update" trigger of the variable does not work at all

3) trying to use other triggers did not work either up until now....

Are there any known bugs around trigger actions that prevent this whole thing from running as expected?

Maybe I need to put all the necessary steps in a makro and fire the makro every time I select and ID value?

Any suggestions are highly welcome!

Jason_Michaelides
Luminary Alumni
Luminary Alumni

I thought the only thing that was in the trigger was updating the variable?  I thought you had a button to apply the selections made in the data island to the real data?

You should always try and minimise the use of triggers as much as possible - they can be a bit flaky and are bypassed by things like "Clear All" and applying bookmarks.

Not applicable
Author

Many thanks again, Jason!

I think I have all I need now to get this thing running.

I will try to keep to one or two buttons which should be ok for users.

Regs,

Thomas

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Sorry if this is stating the obvious but don't forget that you can have many actions in a single button.

Glad you got it sorted mate - there's always a way with QlikView!