Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide Expression in Pivot table Using Macro

Hi,

I have a chart where i need to include the expression in Pivot table, but not display the same in the Pivot table. Similarly I have some dimensions also. I hid the dimensions using the below macro. But the Same is not working for Expressions. Please let me know if you have achieved this using macro/other options. The line   objExp(1).ColWidth = 0 is throwing some error.

sub ShowHide

  set var = ActiveDocument.Variables("VDimshow")

  varValue = var.GetContent.String

  set obj = ActiveDocument.GetSheetObject("CH11")

  set objProp = obj.GetProperties

  set objDim = objProp.Dimensions

set objExp = objProp.Expressions

    if varValue = 0 then

  objDim(0).ColWidth = 0

  var.SetContent 0,true

  objDim(1).ColWidth = 0

  var.SetContent 0,true

objExp(1).ColWidth = 0

var.SetContent 0,true

  end if

  obj.SetProperties objProp

    end sub

Labels (1)
0 Replies