Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I am new to Qlikiview macros. I want to hide every first column of every pivot chart on the dash board. So that I can use along with
Pick(Dimentionality,1,2,3,4....etc) to sort the last expression always.
I got one Macro from one of our friends.
public sub MyHide
call HideColumn("CH26",5)
end sub
private sub HideColumn(ch,n)
set ch = ActiveDocument.GetSheetObject(ch)
ch.SetPixWidth (n), 50
end sub
Can I tweak this macro to to apply to every pivot chat I use....
Thanks
Yes but you have to repeat the instruction
call HideColumn("CH26",5)
defining all the objects (as CH26) where you need to hide the column.
If I give Same object ID for every pivot chart the pivot charts are disappearing.
Is there any way I can group all this pivot charts and use the group name in the macro???
Thanks
The object ID has to be absolut unique within an app. If you renamed it to an already existing object this object will be overwritten. If you want to do your task with a macro you need to repeat it like Alessandro suggest or you wrapped this code into a loop which runs through all sheet-objects - see here an example from APIGuide.qvw which make such sheet.object run:
rem ** remove borders from all listboxes on active sheet **
set x = ActiveDocument.ActiveSheet.GetSheetObjects
Objects = x.SheetObjects
For i = lBound(Objects) To uBound(Objects)
set obj = Objects(i)
if obj.GetObjectType = 1 then 'list boxes
set p = obj.GetProperties
p.Layout.Frame.BorderEffect = 0 'no border
obj.SetProperties p
end if
next
It would only be a starting point for further adjustments ... But what is really your aim? You need really many from these special pivot-charts that an automated approach would be useful. Further, an expression could be better to hide per expression-condition.
- Marcus