Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 questions. I am using the personal edition so it would be helpful to copy and paste the codes here ( I can't open any attached Qlikview document).
1) I have set up a field event that triggers certain actions upon selection of a field, say Field A, in Sheet 1. However, I would like to have another set of actions to be triggered upon selection of Field A in Sheet 2. Is this possible? The field event trigger seems to be universal throughout the entire document and I can't get the trigger to work differently based on the active sheet.
2) Also on field event trigger. Is it possible to activate the field event trigger conditionally based on values of the fields?
E.g. My data looks like this:
Field A | Field B |
---|---|
apple | fruit |
orange | fruit |
USA | country |
pasta | N/A |
My field event trigger works like this. when Field A is selected, I would want the possible values from the corresponding Field B to be selected and clear the selection from Field A. (I need to do this because my other tables are linked to Field B and not Field A).
However, for cases where Field B is 'N/A', I would not want this field event to be triggered and the filter remains on Field A.
Is this possible? With a macro perhaps?
Appreciate any help, thanks.
Dear,
it's quite difficult explain solutions to these questions without an example application
1) You can create an Alternate State, say "State1" (Document properties> Alternate States...>Add).
In the objects in sheet1 set <inherited> while in objects in sheet2 set State1 (General tab of object properties, alternate state).
Now selections in sheet1 will be independent from those in sheet2.
You can do this just for Field A if there are two list boxes, on for each sheet.
Then you are able to add different sets of triggers for the two states (you will find State option as shown below)
2) You can add two actions OnSelect for FieldA:
- Select in field: in field option insert FieldB and in Search String insert =FieldB
- Clear other fields: in field option insert FieldB.
For N/A values, you can add an if statement in searh string in order to handle this case.
Obviously, if you add alternate states, you must specify wich state you are considering, as in image above.
Can this help you?
Please, ask again if it's not clear!
Elena
1)
you can use an if with getactivesheet function (it returns the Sheet ID you find in General tab of shhet properties) in trigger event for the field
=if(wildmatch(GetActiveSheetId(), '*SH01*'), 'Match', 'Not match')
1. Under Settings -> Document Properties -> Triggers,
Define two Field Event Triggers for Field A (both for OnSelect and OnChange
2. First trigger for Field B
Set the action and search string as shown below
3. Second trigger for Field A
Set the action and search string as shown below
You will see the following:
If you select 'apple' in Field A, 'fruit' will be selected in Field B and Field A will be cleared.
If you select 'pasta' in Field A, nothing will be selected in Field B and Field A will not be cleared.
Hope this helps.