Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
montubhardwaj
Specialist
Specialist

How to Select the previous selected field value?

Hi Community,

In my application, I have 5 tabs each having some number of objects in it. I want to have selections in one tab such that will not reflect other tabs. For example, If I am selecting Country='Canada' in tab1, when going to other tabs, this selection should clear off. Up to here it is fine and I am able to achieve this. But If I come back to tab1, I want to have same value selected i.e. Country='Canada'.

Also, if I am changing country to Japan, it should be selected again when I am on tab1 but should clear off while on other tabs. Iam using QV9 SR6 and will be great if we can achieve it through Triggers.

Thanks for you help in advance.

1 Solution

Accepted Solutions
montubhardwaj
Specialist
Specialist
Author

Hello everyone.

I have achieved this one and just wanted to share with you all Yes . It is just so simple using triggers.So here it is:

When I am selecting any value in the field 'Account', Iam creating a variable(Variable1) using Trigger. So, when I am selecting say 'Mr A' in "Account"When I am moving to other sheet "Ignore Selections", any Selected value of Account will get cleared(this is because of trigger used in this sheet).Now, while going back to tab1, I have created a trigger 'on activate' of this tab(tab1), which will select the field Account as Variable1.

Hope that was helpful.

View solution in original post

13 Replies
matt_crowther
Luminary Alumni
Luminary Alumni

Sharma,

I'm assuming you have the triggers sorted for the removal of selections but for the 're-selection' of a previous value I'd suggest looking at Set Analysis - the often ignored use of Set Analysis:

=sum({$1}Sales) will give you the Sales based on your previous selection, =sum({$2}Sales) will give you the sum of Sales based on 2 selections ago...which should be what you require.

I use this for allowing users to easily compare to values side by side: ie select Japan first then Canada and via the above SA you can see the required charts at the same time next to each other or even within the same chart.

Hope that helps,

Matt - Visual Analytics Ltd

montubhardwaj
Specialist
Specialist
Author

Hi Matt,

Thanks for looking into this. But this is not what I want. I have a list box with Country as a field which contains Canada, Japan etc. This tab i.e. tab1 only is having data related to Country and this filter should not affect other tabs. So to make it more simple, Country selection should clear off everytime i move to other tabs. But it should automatically select the value which I had selected before moving to other sheet.

Not applicable

Perhaps a trigger on sheet deactivation getting all selected fields with Country excluded in the Set.

matt_crowther
Luminary Alumni
Luminary Alumni

Sharma,

In that case I'd look to use Set Analysis on the tab that you want to 'ignore the selections in the Country field'.

So it would be similar to: =sum({$<Country = >}Sales)

This should give you the results you're looking for - I've used it to similar effect to seemingly 'detach' sheets.

Hope that helps (this time!)

Matt - Visual Analytics Ltd

montubhardwaj
Specialist
Specialist
Author

Yes... I think this way it can be achieved but not able to do it though Sad

The problem is while coming back to tab1, the country field is geting cleared and not retaining its previous selected value!

matt_crowther
Luminary Alumni
Luminary Alumni

Sharma,

Example file attached that works for me (In v9 SR6).

You shouldn't need any triggers to get this to work. The selections should then remain persistent regardless of what tab you're viewing all the work is done by the Set Analysis expression.

(Apologies for the .qvw - it's an amended previous example)

Hope that helps,

Matt - Visual Analytics Ltd

montubhardwaj
Specialist
Specialist
Author

Many Thanks Matt for all your effort. Yes I agrre with you that Selections made will not affect your expression/report. But it still be visible in "Current Selection box" and will give the wrong impression to the user(though it is not affecting the expression). Ok, lets make it clear through you attached qvw.

For example, Iam making the Selections in tab1 for Account='Mr A' and Month='Mar'. So when I go to the 'Ignore Selections' tab, Account should clear off but Month='Mar'. Till this part, I have achieved.

Now, when Iam going to tab1 i.e. "Make Selections", Account field is not selected anymore(since it gets cleared off as I moved away from this tab). I want to have it selected as before Account='Mr A' .

Hope I have cleared my problem this time Smile

montubhardwaj
Specialist
Specialist
Author

is there any possibility to achieve this using Triggers?

montubhardwaj
Specialist
Specialist
Author

Hello everyone.

I have achieved this one and just wanted to share with you all Yes . It is just so simple using triggers.So here it is:

When I am selecting any value in the field 'Account', Iam creating a variable(Variable1) using Trigger. So, when I am selecting say 'Mr A' in "Account"When I am moving to other sheet "Ignore Selections", any Selected value of Account will get cleared(this is because of trigger used in this sheet).Now, while going back to tab1, I have created a trigger 'on activate' of this tab(tab1), which will select the field Account as Variable1.

Hope that was helpful.