Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Re : Export straight table with macro

Hi all,

I have a straight table and am using macro to export it to excel along with some other objects.it is working fine. Now i need to exclude 2 columns from the straight table while exporting?? is that possible ??

please suggest ??

Thanks in advance

Reena

Tags (1)
7 Replies
Highlighted
Master III
Master III

Re: Re : Export straight table with macro

Hello Reena,

It is possible. I will recommend you to use inbuilt actions of Qlik rather than using macro. Well you can use a coppy the same Straight table with condition of excluding that two columns and let that be Hidden.

Highlighted
Creator III
Creator III

Re: Re : Export straight table with macro

Hi,

As Sujit suggested,

Case 1 :Please take a copy of the existing straight table and in the copy application just hide whatever columns you dont want to export.

Note : Change the object Id in the macro script(as per your macro written).Other wise it will export original straight table only.

Sujit : Could you help me how we can achieve this without macro.(I dont know this)

Regards,

Ajay

Highlighted
Master III
Master III

Re: Re : Export straight table with macro

Exporting an object to excel. You can use action defined export objects

Highlighted
Not applicable

Re: Re : Export straight table with macro

hello..

Thanks fo your reply..

Actually i have to use macro,since i have to export the entire sheet objects to a single sheet. please help me with avoiding the fields

Highlighted
Partner
Partner

Re: Re : Export straight table with macro

Hi Reena,

Then you should use one more straight table excluding those two fields as Sujeeth suggested and that will be hidden. But the macro will export the hidden straight table which doesn't have those two fields.

Cheers,

Naresh

Highlighted

Re: Re : Export straight table with macro

Hi,

May be this would be helpful.

As you Mentioned, already you have code for export to excel. You can add the below code

Sub RemoveDimension

set obj = ActiveDocument.GetSheetObject("CH03")

obj.RemoveDimension 0

obj.RemoveDimension 3

End Sub

After exporting to excel you can add the dimension.

Or you can just hide the dimension when you are exporting excel, then show the dimension.

Sub AddDimension

set obj = ActiveDocument.Sheets("CH03")

obj.AddDimension "Dimension1"

End Sub

Highlighted
MVP & Luminary
MVP & Luminary

Re: Re : Export straight table with macro

Hi,

Hide the columns which you want to exclude by using the

Chart Properties -> Dimension -> Using Enable Conditional option of the dimension

Give some variable assume vShowDim

While triggering the macro add this events in the macro

Event 1: Action -> Add Action -> External -> Set Variable -> Set vShowDim to 0

Event 2: Call your macro here

Event 3: Action -> Add Action -> External -> Set Variable -> Set vShowDim to 1

Hope this helps you.

Regards,

Jagan.