Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi all,
I used a simple macro to hide a column in a pivot table. However, I can't figure out how to UNhide it!
What's the macro code that will reverse this?
Thanks!
Here's the macro code I used:
sub Squeeze
call HideColumn("CH25", 1)
end sub
private sub HideColumn(ch, n)
set ch = ActiveDocument.GetSheetObject(ch)
ch.SetPixWidth (n-1), 0
end sub
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Sam,
I'll wade in here with a value assessment. Try not to use a macro. Macros can be very problematic. You'll find many macros on this forum (many written by myself) that I wish could be deleted because there are better ways to do things with the current version.
Welcome to QlikView. We come from many different languages and cultures on this forum, and communication is not always perfectly smooth. Please be gentle on the forums and assume the best intentions and professional demeanor from all posters. I take Ramon's response as asking a helpful clarifying question.
A better alternative, if it will give you the desired results, is to use the Expression or Dimensional conditional property to suppress the column. If the condition is false, the column will not exist in the table. This may not be what you want if you need the column to form rows or export data. Let us know if you want more info on this option.
If you need to use a macro, the second parameter of SetPixWidth is the column width. You are setting it to 0 to hide the column. I suspect if you set it to a number greater then zero your column will be visible.
Be aware that your macro may not work if deployed to the QlikView Server. 
-Rob
 
					
				
		
 ramoncova06
		
			ramoncova06
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		not sure why you would use a macro when you can use conditional to do the same thing, unless you are exporting data with the marco
 
					
				
		
Ramon,
I appreciate the response. Unfortunately, it's not helpful for two reasons:
1) You didn't answer my question. I didn't ask for a value assessment.
2) I'm a beginner and I don't know what I'm doing. You offer an alternative without explaining it.
Thanks,
Sam
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Sam,
I'll wade in here with a value assessment. Try not to use a macro. Macros can be very problematic. You'll find many macros on this forum (many written by myself) that I wish could be deleted because there are better ways to do things with the current version.
Welcome to QlikView. We come from many different languages and cultures on this forum, and communication is not always perfectly smooth. Please be gentle on the forums and assume the best intentions and professional demeanor from all posters. I take Ramon's response as asking a helpful clarifying question.
A better alternative, if it will give you the desired results, is to use the Expression or Dimensional conditional property to suppress the column. If the condition is false, the column will not exist in the table. This may not be what you want if you need the column to form rows or export data. Let us know if you want more info on this option.
If you need to use a macro, the second parameter of SetPixWidth is the column width. You are setting it to 0 to hide the column. I suspect if you set it to a number greater then zero your column will be visible.
Be aware that your macro may not work if deployed to the QlikView Server. 
-Rob
 
					
				
		
Thanks for the background, Rob, and the explanation.
