<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Macro to export straight table to csv after reload on server. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991019#M644870</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From testing it would seem the "&lt;STRONG&gt;OnPostReload&lt;/STRONG&gt;" event is not being triggered when the Qlikview Management Console reloads the QVW via a task and this might be why the Macro isn't being run.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Dec 2015 12:21:59 GMT</pubDate>
    <dc:creator>pgriffiths</dc:creator>
    <dc:date>2015-12-11T12:21:59Z</dc:date>
    <item>
      <title>Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991017#M644868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been trying to do this for some time, but I can't seem to find an answer.&lt;BR /&gt;I need to export a straight table to a CSV file.&lt;BR /&gt;Below is a test setup I am using to simpify the process while investigating the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I first create some test data in a load script as follows;&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14497472681516410" jivemacro_uid="_14497472681516410"&gt;
&lt;P&gt;//Example Data&lt;BR /&gt;QUALIFY *;&lt;BR /&gt;Example_Data:&lt;BR /&gt;LOAD * Inline &lt;BR /&gt;[Asset,User,OS&lt;BR /&gt;UK01,sparnaby,WinVista&lt;BR /&gt;UK02,tbrown,Win7&lt;BR /&gt;UK03,mrichards,Win8&lt;BR /&gt;];&lt;/P&gt;




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To test the output folder has access, I output this table using the Store command as follows;&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14497472892022905" jivemacro_uid="_14497472892022905"&gt;
&lt;P&gt;STORE Example_Data into c:\TestCSV\Table_Example_Data.csv (txt);&lt;/P&gt;




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then create a straight table to output the example data and add a count field with a total. I call this stright table "&lt;STRONG&gt;Table_Data&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create a Macro to output the straight table as follows;&lt;/P&gt;&lt;PRE __default_attr="php" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14497473547433109" jivemacro_uid="_14497473547433109"&gt;
&lt;P&gt;Sub ExportTest&lt;BR /&gt; Set obj = ActiveDocument.GetSheetObject("Table_Data")&lt;BR /&gt; obj.ExportBiff "c:\TestCSV\Data.csv"&lt;BR /&gt;End Sub&lt;/P&gt;




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Edit Module section this macro is in, I set the following fileds;&lt;BR /&gt;Requested Module Security: &lt;STRONG&gt;System Access&lt;/STRONG&gt;&lt;BR /&gt;Current Local Security: &lt;STRONG&gt;Allow System Access&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the main Qlikview document I also go into Settings-&amp;gt;Document Properties-&amp;gt;[Triggers] tab.&lt;BR /&gt;I select "&lt;STRONG&gt;OnPostReload&lt;/STRONG&gt;" and click [&lt;STRONG&gt;Add Action(s)&lt;/STRONG&gt;] button.&lt;BR /&gt;I add "&lt;STRONG&gt;Run Macro&lt;/STRONG&gt;" and set the Macro Name to "&lt;STRONG&gt;ExportTest&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then setup security Settings on the Qlikview Management Server.&lt;BR /&gt;[&lt;STRONG&gt;System&lt;/STRONG&gt;] tab-&amp;gt;[&lt;STRONG&gt;Setup&lt;/STRONG&gt;] subtab-&amp;gt;Select Server from the list.&lt;BR /&gt;[&lt;STRONG&gt;Security&lt;/STRONG&gt;] tab on the server.&lt;BR /&gt;[&lt;STRONG&gt;Tick&lt;/STRONG&gt;] Allow macro execution on server &lt;BR /&gt;[&lt;STRONG&gt;Tick&lt;/STRONG&gt;] Allow unsafe macro execution on server&lt;BR /&gt;Clicked [&lt;STRONG&gt;Apply&lt;/STRONG&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then setup the output folder &lt;STRONG&gt;c:\TestCSV&lt;/STRONG&gt; and added full permissions for the AD accounts the qlikview services run on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I open and run the report fine from the qlikview client and &lt;STRONG&gt;c:\TestCSV&lt;/STRONG&gt; folder contains both the output files&lt;BR /&gt;&lt;STRONG&gt;Data.csv&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Table_Example_Data.csv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problems is if I create a task on the Qlikview Management Server, it only outputs the one file.&lt;BR /&gt;&lt;STRONG&gt;Table_Example_Data.csv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any idea how to do this?.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT - I have added the example QVW file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Dec 2015 11:40:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991017#M644868</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-10T11:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991018#M644869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been reading the APIGuide and as a result tried the following macro that I believe should of worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub ExportTest&amp;nbsp; &lt;BR /&gt; Set obj = ActiveDocument.GetSheetObject("Table_Data")&amp;nbsp; &lt;BR /&gt; obj.ServerSideExport "c:\TestCSV\Data.csv", ";", 0 '0=ANSI(Default)&lt;BR /&gt;End Sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This still doesn't output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I even tried setting the folder permissions to allow everyone read write access, just to make sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This ServerSideExport seems to be a function to do exactly what I need, but it doesn't work?. Anyone know why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 10:45:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991018#M644869</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-11T10:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991019#M644870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From testing it would seem the "&lt;STRONG&gt;OnPostReload&lt;/STRONG&gt;" event is not being triggered when the Qlikview Management Console reloads the QVW via a task and this might be why the Macro isn't being run.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 12:21:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991019#M644870</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-11T12:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991020#M644871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know how to trigger a macro when a task is run in Qlikview Management Console?.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 15:03:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991020#M644871</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-11T15:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991021#M644872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macros won't executed per qmc reload-task. You need to run such macros per Fat-Client either per command-batch or vbs, see here for examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/768543"&gt;Re: Run Macro on Reload (From Server)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/908028"&gt;Re: QlikView Batch Jobs execution using CONTROL-M&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/296469"&gt;Re: Sending mails macro vbs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 15:12:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991021#M644872</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-11T15:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991022#M644873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Marcus, I can see why it was not working now.&lt;/P&gt;&lt;P&gt;Done some testing and can see how the batch file works.&lt;/P&gt;&lt;P&gt;I should be able to trigger the batch file from the load script of a QVW, but wondered if it was possible to instead detect if the load script was running on a Qlikview Management Console from within the load script?&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;P&gt;if(Application.Parent.Name = 'GMC', {Do-Something-To-Launch-Batch-File})&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 16:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991022#M644873</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-11T16:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991023#M644874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use for such detecting in front tasks which writes variable-values (stop/run) in txt-files which are not only used directly in qlikview also to control various batches, vbs-routines and excels with OnOpen-routines. But in your case might (I haven't tested it yet) a check on systemvariables like QvRoot or WinRoot easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Dec 2015 00:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991023#M644874</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-12T00:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991024#M644875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like the idea. Many thanks.&lt;/P&gt;&lt;P&gt;I could look for a custom made file that exists only on the server to determine if the script if being run on the server.&lt;/P&gt;&lt;P&gt;Maybe there is already a file that is unique to the server.&lt;/P&gt;&lt;P&gt;I will post what I find.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 09:17:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991024#M644875</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-14T09:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991025#M644876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I don't understand is why you want to export the table using macros, when you could do it in the load script with the Store command?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 13:53:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991025#M644876</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2015-12-14T13:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991026#M644877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought the Store command only worked with Tables, not Straight Tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 15:12:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991026#M644877</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-14T15:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991027#M644878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Store is a load script command and works with the tables you have in your QlikView application/load script, not with the charts/tables etc you have in the QlikView gui, so no it does not work with Straight Table objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you can create a table in your load script which has the same data as your Straight Table object, and then Store it as a txt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2015 12:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991027#M644878</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2015-12-15T12:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991028#M644879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for confirmation. Thought for a moment I had missed something and gone down the wrong route.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2015 12:30:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/991028#M644879</guid>
      <dc:creator>pgriffiths</dc:creator>
      <dc:date>2015-12-15T12:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export straight table to csv after reload on server.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/1509917#M644880</link>
      <description>&lt;P&gt;This is amazing... but I was wondering if there is a workaround if the export csv file is more than 65000 rows?&lt;/P&gt;&lt;P&gt;At the minute my output is putting the remaining rows onto a new tab Sheet2, ie it's like old school Excel with the limited number of rows available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My very simple script is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sub Export_Trust&lt;BR /&gt;&lt;BR /&gt;set trust1 = ActiveDocument.GetSheetObject("CH205")&lt;BR /&gt;set trust2 = ActiveDocument.GetSheetObject("CH210")&lt;BR /&gt;set trust3 = ActiveDocument.GetSheetObject("CH207")&lt;/P&gt;&lt;P&gt;trust1.ExportBiff "X:\Business Performance\Finance\Cash\Download\QVATC.csv"&lt;BR /&gt;trust2.ExportBiff "X:\Business Performance\Finance\Cash\Download\QVTrust1.csv"&lt;BR /&gt;trust3.ExportBiff "X:\Business Performance\Finance\Cash\Download\QVTrust2.csv"&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 16:35:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-straight-table-to-csv-after-reload-on-server/m-p/1509917#M644880</guid>
      <dc:creator>cmccafferty</dc:creator>
      <dc:date>2018-11-20T16:35:53Z</dc:date>
    </item>
  </channel>
</rss>

