<?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: Formatting export file name in macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763801#M454161</link>
    <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;I'm gonna grab your suggestion, but there's something which I miss:&lt;/P&gt;&lt;P&gt;I made two variables:&lt;/P&gt;&lt;P&gt;vExportDay&lt;/P&gt;&lt;P&gt;Timestamp(Now(), 'DDMMYYYY')&lt;/P&gt;&lt;P&gt;vExportTime&lt;/P&gt;&lt;P&gt;Timestamp(Now(), 'HHmmSS')&lt;/P&gt;&lt;P&gt;In the macro I've substituted the previous instruction with this one:&lt;/P&gt;&lt;P&gt;sObject.Export ActiveDocument.GetVariable("vAS400DataFolder").getContent.string &amp;amp; "ExportAS_" &amp;amp; ActiveDocument.GetVariable("vExportDay").getContent.string &amp;amp; "_" &amp;amp; ActiveDocument.GetVariable("vExportTime").getContent.string &amp;amp; ".csv", ";"&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the result is&amp;nbsp;&lt;/P&gt;&lt;P&gt;ExportAS_Timestamp(Now(), 'DDMMYYYY')_Timestamp(Now(), 'HHmmSS').csv&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Pls, forgive me for my clumsiness...&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp; N.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 17:34:55 GMT</pubDate>
    <dc:creator>NickP_DF</dc:creator>
    <dc:date>2020-11-23T17:34:55Z</dc:date>
    <item>
      <title>Formatting export file name in macro</title>
      <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763440#M454142</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I need to create an exported file by using a macro and I'd like that its format name would contain the current date/time with this format:&lt;/P&gt;&lt;P&gt;ExportAS_YYYYMMDD_HHMMSS.csv&lt;/P&gt;&lt;P&gt;My line command is:&lt;/P&gt;&lt;P&gt;sObject.Export "ExportAS_" &amp;amp; Day(Date()) &amp;amp; Month(Date()) &amp;amp; Year(Date()) &amp;amp; "_" &amp;amp; Hour(Time()) &amp;amp; Minute(Time()) &amp;amp; Second(Time()) &amp;amp; ".csv", ";"&lt;/P&gt;&lt;P&gt;but the length of every part of the file name should unwanted change&amp;nbsp; (eg. at 9 o'clock it should be ExportAS_20201121_93000 instead of&amp;nbsp;ExportAS_20201121_&lt;STRONG&gt;0&lt;/STRONG&gt;93000 ) .&lt;/P&gt;&lt;P&gt;Could someone help me, please?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;N.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 09:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763440#M454142</guid>
      <dc:creator>NickP_DF</dc:creator>
      <dc:date>2020-11-21T09:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting export file name in macro</title>
      <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763444#M454143</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/86055"&gt;@NickP_DF&lt;/a&gt;, maybe there is a better way but as a solution you can crete a function to add the zero:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;function CheckZero(value)
  if value&amp;lt;10 then
    CheckZero="0"&amp;amp;value
  else
    CheckZero=value
  end if
end function &lt;/LI-CODE&gt;&lt;P&gt;and call this function in each aprt that can have a precedent zero:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CheckZero(Day(Date())) &amp;amp; CheckZero(Month(Date())) &amp;amp; Year(Date()) &amp;amp; "_" &amp;amp; CheckZero(Hour(Time())) &amp;amp; CheckZero(Minute(Time())) &amp;amp; CheckZero(Second(Time()))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 10:57:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763444#M454143</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2020-11-21T10:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting export file name in macro</title>
      <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763731#M454155</link>
      <description>&lt;P&gt;You could consider to do this within a variable in the UI with something like: timestamp(now(), 'YourFormat') and calling then this variable within the macro instead of struggling with the limited vbs date/formating-features.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 13:54:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763731#M454155</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-11-23T13:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting export file name in macro</title>
      <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763801#M454161</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;I'm gonna grab your suggestion, but there's something which I miss:&lt;/P&gt;&lt;P&gt;I made two variables:&lt;/P&gt;&lt;P&gt;vExportDay&lt;/P&gt;&lt;P&gt;Timestamp(Now(), 'DDMMYYYY')&lt;/P&gt;&lt;P&gt;vExportTime&lt;/P&gt;&lt;P&gt;Timestamp(Now(), 'HHmmSS')&lt;/P&gt;&lt;P&gt;In the macro I've substituted the previous instruction with this one:&lt;/P&gt;&lt;P&gt;sObject.Export ActiveDocument.GetVariable("vAS400DataFolder").getContent.string &amp;amp; "ExportAS_" &amp;amp; ActiveDocument.GetVariable("vExportDay").getContent.string &amp;amp; "_" &amp;amp; ActiveDocument.GetVariable("vExportTime").getContent.string &amp;amp; ".csv", ";"&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the result is&amp;nbsp;&lt;/P&gt;&lt;P&gt;ExportAS_Timestamp(Now(), 'DDMMYYYY')_Timestamp(Now(), 'HHmmSS').csv&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Pls, forgive me for my clumsiness...&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp; N.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 17:34:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763801#M454161</guid>
      <dc:creator>NickP_DF</dc:creator>
      <dc:date>2020-11-23T17:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting export file name in macro</title>
      <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763802#M454162</link>
      <description>&lt;P&gt;Thank you, Ruben, for your suggestion &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 17:37:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763802#M454162</guid>
      <dc:creator>NickP_DF</dc:creator>
      <dc:date>2020-11-23T17:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting export file name in macro</title>
      <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763939#M454166</link>
      <description>&lt;P&gt;These variables needs to be evaluated within the UI which is enable by adding an equal-sign before, like:&lt;/P&gt;&lt;P&gt;vExportDay&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;Timestamp(Now(), 'DDMMYYYY')&lt;/P&gt;&lt;P&gt;vExportTime&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;Timestamp(Now(), 'HHmmSS')&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 07:09:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1763939#M454166</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-11-24T07:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting export file name in macro</title>
      <link>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1764472#M454201</link>
      <description>&lt;P&gt;...fast &amp;amp; easy&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you so much, Marcus.&lt;/P&gt;&lt;P&gt;N.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 17:00:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formatting-export-file-name-in-macro/m-p/1764472#M454201</guid>
      <dc:creator>NickP_DF</dc:creator>
      <dc:date>2020-11-25T17:00:30Z</dc:date>
    </item>
  </channel>
</rss>

