Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide Column/Expression in Pivot table

Dear all,

Please see below Pivot table...

I want a Variance only for Current Month (Like April-March).

How to hide other months Columns?

I know we can Hide in Straight Table but some what reason I want only in Pivot table.

Pivot Hide Column1.PNG.png

Please see attached excel and qvw file as sample data.

Regards

Vinay

5 Replies
Not applicable
Author

Can u attach the sample QVW file.

Not applicable
Author

Ok With Attachments.


Not applicable
Author

Please any body can help!!!!

I have tried below Macro but it hide/disable all second expression.

Any Idea to restrict particular month?

SUB EnableExp1 

    SET chart = ActiveDocument.GetSheetObject("CH01") 

    SET cp = chart.GetProperties 

    SET expr = cp.Expressions.Item(1).Item(0).Data.ExpressionData 

    expr.Enable = TRUE 'Enable Second expression 

    chart.SetProperties cp 

END SUB 

 

SUB DisableExp1 

    SET chart = ActiveDocument.GetSheetObject("CH01") 

    SET cp = chart.GetProperties 

    SET expr = cp.Expressions.Item(1).Item(0).Data.ExpressionData 

    expr.Enable = FALSE 'Disable Second expression 

    chart.SetProperties cp 

END SUB 

anbu1984
Master III
Master III

Replace your variance expression by If(Left(Mnth,3)=Month(Today()),<Your_variance_expression>)

Then Select "Suppress Zero Values" in Presentation.

Not applicable
Author

Hi Anbu,

I have done as suggested but I can't get rid of this -(Hyphen). see my expression..

if(Left(Mnth,3)=Month(Today()),sum(Sales)-before(sum(Sales)))

Hide column1.PNG.png

Thanks

Vinay