Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
is it possible to set a field trigger only on a specific sheet?
What I want to achieve is to have a field (Field 1) which is used in two different sheets.
In sheet A, Field 1 should be cleared when Field 2 is selected. In sheet B, Field 1 should stay selected when Field 2 is selected.
Is this possible in Qlikview?
Thanks.
Hi,
I am not sure I understand what you are saying. If I add the following (and ad triggers as appropriate) it seems to work (I think …);
Public Sub ConditionalClear1() if ActiveDocument.ActiveSheet.GetProperties.Name="SheetA" then ActiveDocument.Fields("Field1").Clear end if End Sub Public Sub ConditionalClear2() if ActiveDocument.ActiveSheet.GetProperties.Name="SheetA" then ActiveDocument.Fields("Field2").Clear end if End Sub
QVW attached again, let me know if it helps or I am missing something.
Cheers,
Chris.
Hi,
You can use a macro attached to trigger action on the field that clears the field (or not) depending on the sheet;
Public Sub ConditionalClear() if ActiveDocument.ActiveSheet.GetProperties.Name="SheetA" then ActiveDocument.Fields("Field1").Clear end if End Sub
Attaching my QVW, although personal edition so you may not be able to open.
You probably want to test this approach a lot, as the macros can be flaky/environment dependent.
Cheers,
Chris.
Hi,
thanks for the hint. That seems like it could be a solution.
Nevertheless though I would need two Macros then as I would need "Field1" to be cleared when "Field2" is selected but also "Field2" to be cleared when "Field1" is selected.
So I would need to put a Macro on both fields in order to each clear the other one if selected.
But that doesn't seem to work. Somehow I can always only create one Macro and if I try to use a different one on the other field the script of both macros will always automatically stay the same.
Am I missing something here?
Hi,
I am not sure I understand what you are saying. If I add the following (and ad triggers as appropriate) it seems to work (I think …);
Public Sub ConditionalClear1() if ActiveDocument.ActiveSheet.GetProperties.Name="SheetA" then ActiveDocument.Fields("Field1").Clear end if End Sub Public Sub ConditionalClear2() if ActiveDocument.ActiveSheet.GetProperties.Name="SheetA" then ActiveDocument.Fields("Field2").Clear end if End Sub
QVW attached again, let me know if it helps or I am missing something.
Cheers,
Chris.
Glad it is working. I don't find it the most intuitive thing to work with.