Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone.
I have a QlikView where when a certain sheet is opened I would like to have two quarters of the financial year selected so I can view data side by side.
I have it working perfectly if I have the field selectors on screen and manually select the two quarters that I would like. However, I seem to be having difficulty getting my macro to select more than one quarter at a time.
This is what I have at the moment:
Sub ScoreCard()
ActiveDocument.ActivateSheetByID "SH21"
ActiveDocument.GetField("Quarter").Select "2009/10 Q2"
End Sub
Please could anyone advise how I make it select both "2009/10 Q2" and "2009/10 Q3"
Thanks,
Gethyn.
Hi.
For this You have to use toggle select..
sub g()
ActiveDocument.ActivateSheetByID "SH01"
set Y = activedocument.fields("Year")
Y.select "2000"
Y.toggleselect "2001"
Y.toggleselect "2002"
end sub
Try this...
Hi Gethyn,
Don't know what the reason is you use a macro for making the correct selection?
You could think of using set analysis or something ...
{< Quarter += '2009/10 Q2', Quarter += '2009/10 Q3' >}
Anita
Hi Anita,
Thanks for the speedy reply.
I'm not sure that set analysis is what I need as all I want is to have it select the two quarters as the default selection when the sheet is opened.
Gethyn.
You could add a macro to clear all selections when entering the sheet.
And in set analysis you could add the default selection ... this to be sure the selection is always correct.
Ofcourse it can be done in the macro aswell ... just depends on what goals you have.
Hi.
For this You have to use toggle select..
sub g()
ActiveDocument.ActivateSheetByID "SH01"
set Y = activedocument.fields("Year")
Y.select "2000"
Y.toggleselect "2001"
Y.toggleselect "2002"
end sub
Try this...
Hi Blessy,
That worked perfectly and did exactly what I wanted.
Thanks,
Gethyn.
Welcome....