Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Issues...
I have a report which shows QlikView Report Usage.
On tab 1, I want to show a chart showing the number of reports opened by users by day.
On tab 2, I want to show specific detail about a filtered report, update schedule etc...
I have all of this in place...
The issue that I have is that on tab 2, my filter needs to be set to "Always show one value" but having this disrupts tab 1 because this then only shows data for the filtered report when I need it to show for all...
What I would like to to is programatically play with the filter on tab 2...
When the sheet is activated, set the filter field value (qvw_Code) to "02A" then turn set the list box value to "Always One Selected Value" = true.
When the sheet is deactivated, set the list box value "Always One Selected Value" = false then clear the filters.
Can someone please give some guidance on the macro I need for setting the list box "Always One Selected Value"?
I have had a look at the APIguide with no joy....
Thanks
Paul
Hi Paul,
here what you are looking for:
sub SetOneAndOnlyOne
set obj = ActiveDocument.GetSheetObject("LB01")
set boxfield=obj.GetField
set fprop = boxfield.GetProperties
if boxfield.GetFieldFlags.OneAndOnlyOne then
fprop.OneAndOnlyOne = false
else
fprop.OneAndOnlyOne = true
end if
boxfield.SetProperties fprop
end sub
every time you call the macro the filed wil be set or unset. Be carefull to have something that select one value before call the macro for set the OneAndonlyOne
Andrea
The property you are looking for is on the Field (not listbox) and is called OneAndOnlyOne.
Hi Paul,
here what you are looking for:
sub SetOneAndOnlyOne
set obj = ActiveDocument.GetSheetObject("LB01")
set boxfield=obj.GetField
set fprop = boxfield.GetProperties
if boxfield.GetFieldFlags.OneAndOnlyOne then
fprop.OneAndOnlyOne = false
else
fprop.OneAndOnlyOne = true
end if
boxfield.SetProperties fprop
end sub
every time you call the macro the filed wil be set or unset. Be carefull to have something that select one value before call the macro for set the OneAndonlyOne
Andrea
Thanks Andrea this has done the trick for me....
Regards
Paul
I just needed the same solution. Thanks to both for asking & answering.
Cheers - DV
Thanks for the code snippet.
I removed the If condition and I am using it with the OnOpen Trigger.