<?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: Month()/Day() Functions with Leading Zeros? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334201#M492129</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually it is simpler than that:&lt;/P&gt;&lt;P&gt;date(dat, 'YYYYMMDD')&lt;/P&gt;&lt;P&gt;Speaking of macro - you can use Evaluate, where any QV function can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2012 10:26:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-08-02T10:26:24Z</dc:date>
    <item>
      <title>Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334197#M492125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a user-defined function in a Macro and require Months and Days in the format of "00".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that, as I am running the function from a Load Script, the following line of code does not work:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;MakeDateKey = ActiveDocument.Evaluate("Num(Year(dat),'0000') &amp;amp; Num(Month(dat),'00') &amp;amp; Num(Day(dat),'00')")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;So how do I convert/format the following so that Month() and Day() will always return a 2-digit number?:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;MakeDateKey = Year(dat) &amp;amp; Month(dat) &amp;amp; Day(dat) &lt;/SPAN&gt;&lt;A&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 09:52:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334197#M492125</guid>
      <dc:creator />
      <dc:date>2012-08-02T09:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334198#M492126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;*Edit:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;So how do I convert/format the following so that Month() and Day() will always return a 2-digit number?:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;MakeDateKey = Year(dat) &amp;amp; Month(dat) &amp;amp; Day(dat)&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 09:54:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334198#M492126</guid>
      <dc:creator />
      <dc:date>2012-08-02T09:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334199#M492127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 8pt;"&gt;Num(Year(dat),'0000') &amp;amp; Num(Month(dat),'00') &amp;amp; Num(Day(dat),'00') as MakeDateKey&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 10:04:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334199#M492127</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-02T10:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334200#M492128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;STRONG&gt;swuehl&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I did originally - however I will be using this in several places so I require it within a Macro function (where the "Num" function isn't recognised).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other thoughts?&amp;nbsp; &lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 10:07:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334200#M492128</guid>
      <dc:creator />
      <dc:date>2012-08-02T10:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334201#M492129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually it is simpler than that:&lt;/P&gt;&lt;P&gt;date(dat, 'YYYYMMDD')&lt;/P&gt;&lt;P&gt;Speaking of macro - you can use Evaluate, where any QV function can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 10:26:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334201#M492129</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-02T10:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334202#M492130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya &lt;STRONG&gt;Michael&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I'm running this within a Macro - the above function won't work (the single quote denotes a &lt;EM&gt;comment&lt;/EM&gt;, and the function &lt;STRONG&gt;Date(dat,"YYYYMMDD")&lt;/STRONG&gt; doesn't exist).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, you cannot use &lt;STRONG&gt;ActiveDocument.Evaluate&lt;/STRONG&gt; from a Load Script as the Document doesn't technically exist until after the refresh (see here: &lt;A _jive_internal="true" href="https://community.qlik.com/message/209607#209607"&gt;http://community.qlik.com/message/209607#209607&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently using the following IF statements to achieve the desired result (it's not ideal though!):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has any other thoughs please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'*** Return DateKey (YYYYMMDD) from DateTime ***'&lt;BR /&gt;Public Function MakeDateKey(dat)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'*** Return -1 for unknown ***'&lt;BR /&gt;If (dat = "") Then&lt;BR /&gt;MakeDateKey = -1&lt;BR /&gt;Else&lt;BR /&gt;strYear = CStr(Year(dat))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'*** Add leading zero if required ***'&lt;BR /&gt;If ((Month(dat)+0) &amp;lt; 10) Then&lt;BR /&gt;strMonth = CStr("0" &amp;amp; Month(dat))&lt;BR /&gt;Else&lt;BR /&gt;strMonth = CStr(Month(dat))&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'*** Add leading zero if required ***'&lt;BR /&gt;If ((Day(dat)+0) &amp;lt; 10) Then&lt;BR /&gt;strDay = CStr("0" &amp;amp; Day(dat))&lt;BR /&gt;Else&lt;BR /&gt;strDay = CStr(Day(dat))&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MakeDateKey = (strYear &amp;amp; strMonth &amp;amp; strDay) + 0 ' Add "0" to Cast to number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 10:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334202#M492130</guid>
      <dc:creator />
      <dc:date>2012-08-02T10:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334203#M492131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you elaborate why you want to use a Macro at all for doing this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 11:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334203#M492131</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-02T11:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334204#M492132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya &lt;STRONG&gt;swuehl&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is unfortunately a side-effect from a previous question I have posted:&amp;nbsp; &lt;A _jive_internal="true" href="https://community.qlik.com/thread/58568?tstart=0"&gt;http://community.qlik.com/thread/58568?tstart=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to perform some transformations of the data - althought they need to be performed on the QV-side due to restrictions connecting via ODBC.&amp;nbsp; My ultimate goal is to automatically refresh the data periodically - so I need all the control to be within the QV Load Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a better methedology/best-practice way for achieving this then please let me know!&amp;nbsp; Otherwise I am destined to re-write my VBA functions from MS Access in QV VBS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 11:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334204#M492132</guid>
      <dc:creator />
      <dc:date>2012-08-02T11:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334205#M492133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I've read your other thread, but I am still unclear why you want to use macros for something like IIF or NZ, where you could use QV builtin functions instead in your load script (within the LOAD part, not the SQL SELECT part).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably I miss some essential requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 11:34:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334205#M492133</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-02T11:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334206#M492134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya &lt;STRONG&gt;swuehl&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I was to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Num(Year(DateTimeCallOpened),'0000') &amp;amp; Num(Month(DateTimeCallOpened),'00') &amp;amp; Num(Day(DateTimeCallOpened),'00') as DateCallOpened_Key ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...within my Script for the Date Key of when a Call was opened, then I would have to use the same line of code for calculating the Date Key for when a Call was closed... and for the open/closed times, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This duplication of code is a lot of work, prone to errors, and is not maintainable if the forumla changes in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating a user-defined function to run this transformation is much more preferable... unless you know of a better way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to QlikView (without any formal training) - and I am a Software Engineer by trade! - so I am happy to listen to suggestions for better ways to achieve my desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 11:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334206#M492134</guid>
      <dc:creator />
      <dc:date>2012-08-02T11:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334207#M492135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, you can use variables to hold expression definitions at one place. If you need to pass the field name(s), use dollar sign expansion with parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:13:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334207#M492135</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-02T12:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334208#M492136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is that not MORE complicated than writing a Macro function?!&amp;nbsp; &lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be the benefit of using variables rather than user-defined functions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:23:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334208#M492136</guid>
      <dc:creator />
      <dc:date>2012-08-02T12:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334209#M492137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variables are relaible, they always work.&amp;nbsp; Macros depend on many things external to QV - client, user actions...&amp;nbsp; I better use ten variables than one macro if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334209#M492137</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-02T12:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334210#M492138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;STRONG&gt;Michael&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's handy to know... can you explain what you mean by "client/user actions" causing Macros to not work?... under what circumstances are you referring?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:34:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334210#M492138</guid>
      <dc:creator />
      <dc:date>2012-08-02T12:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334211#M492139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IMHO, following does not look complicated, is easy to maintain and understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set MakeKey = Num(Year($1),'0000') &amp;amp; Num(Month($1),'00') &amp;amp; Num(Day($1),'00');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set MakeKey2 = Date($1,'YYYYMMDD');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *,&amp;nbsp; $(MakeKey(Date)) as Key, $(MakeKey2(Date)) as Key2 INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;10.06.2012&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;01.01.2012&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A dollar sign expansion with parameter is not very different from a user defined function, is it?&lt;/P&gt;&lt;P&gt;AND you can use all QV functions and access the data model like if you've written the code inplace (that's obviously what happens, the code will be replaced by the dollar sign expansion).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:36:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334211#M492139</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-02T12:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334212#M492140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Examples of the most typical situations:&lt;/P&gt;&lt;P&gt;Macros may work in Desktop client and IE plugin, but not in AJAX client.&lt;/P&gt;&lt;P&gt;Usr may allow or not allow macros, or allow "safe" when functionality requires "system access"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it is often impossible to avoid macros completely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:41:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334212#M492140</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-02T12:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334213#M492141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This discussion has been massively helpful (even if we have deviated off-topic slightly!) - thank you both very much&amp;nbsp; &lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Swuehl&lt;/STRONG&gt;:&amp;nbsp; I agree - this isn't much different from using a user-defined function... although would you be able to explain your &lt;STRONG&gt;INLINE&lt;/STRONG&gt; statement with date literals, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Michael&lt;/STRONG&gt;:&amp;nbsp; Thanks for this - these are things which I probably wouldn't have considered (until it was too late!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will definitely bear both you comments in mind and have a re-think!&amp;nbsp; &lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 12:50:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334213#M492141</guid>
      <dc:creator />
      <dc:date>2012-08-02T12:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334214#M492142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't see where we were going off-topic, don't you want to format your Keyfield anymore like I've done with MakeKey/MakeKey2?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INLINE is just to create a input data source that I can load and demonstrate the dollar sign expansion. &lt;/P&gt;&lt;P&gt;Just replace it with &lt;EM&gt;FROM YourTable &lt;/EM&gt;or however you get your data in QV. The Date field values will be interpreted as dates if your standard date format is appropriate (like SET DateFormat='DD.MM.YYYY';)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 13:01:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334214#M492142</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-02T13:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Month()/Day() Functions with Leading Zeros?</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334215#M492143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah yes, of course - thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By "off-topic" I was reffering to the slightly different discussion relating to the use of variables vs. macros&amp;nbsp; &lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&amp;nbsp; Essentially required to get the my desired result - but not exactly a direct answer to the original question&amp;nbsp; &lt;STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All VERY useful though and much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 13:05:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Day-Functions-with-Leading-Zeros/m-p/334215#M492143</guid>
      <dc:creator />
      <dc:date>2012-08-02T13:05:16Z</dc:date>
    </item>
  </channel>
</rss>

