<?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: Script function Weekname returns a monthname in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466656#M699485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, after some further testing this was also my conclusion, and eventhough the make date of week 40 is made for 6th day of the week, the Weekname function transfers it into the same timestamp as the month. My first assumption was that it would only convert the part where the classification was true, but as soon as the timestamp have been converted,it sticks eventhough the same timestamp may appear as week as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution was to make a text representation as well, a bit more complex but it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2012 13:34:38 GMT</pubDate>
    <dc:creator>skovsgaard</dc:creator>
    <dc:date>2012-11-28T13:34:38Z</dc:date>
    <item>
      <title>Script function Weekname returns a monthname</title>
      <link>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466654#M699483</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;I have data numbered 1 to 12 for months and 1 to 52 for weeks, and I am using Monthname and Weekname to convert it into Month and Weeks. However when doing so Week 40 2012 returns Oct 2012. See below script for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InlineLoad:&lt;BR /&gt;Load * inline [MonthNo, Year, Classification&lt;BR /&gt;9, 2012, Month&lt;BR /&gt;39, 2012, Week&lt;BR /&gt;10, 2012, Month&lt;BR /&gt;40, 2012, Week&lt;BR /&gt;11, 2012, Month&lt;BR /&gt;41, 2012, Week&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Convert:&lt;BR /&gt;Load&lt;BR /&gt;*,&lt;BR /&gt;if(Classification = 'Month', monthname(MakeDate(Year,MonthNo,1)), Weekname(MakeWeekDate(Year,MonthNo,6)) ) as Period,&lt;BR /&gt;if(Classification = 'Month', 'A', Weekname(MakeWeekDate(Year,MonthNo,6)) ) as Period1&lt;BR /&gt;Resident InlineLoad;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table InlineLoad;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For week 40, Period returns "Oct 2012" but if I dont convert to Months as in Period1 it correctly returns "2012/40" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain why, or is this a bug?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Soren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 14:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466654#M699483</guid>
      <dc:creator>skovsgaard</dc:creator>
      <dc:date>2012-11-26T14:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script function Weekname returns a monthname</title>
      <link>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466655#M699484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both Week 40 and Month 10 share the same numeric value in your sample, 41183 or 2012-10-01 as ISO Date.&lt;/P&gt;&lt;P&gt;I believe that's the issue here, you want to use two different text representations for the same numeric value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2012 14:33:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466655#M699484</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-11-26T14:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script function Weekname returns a monthname</title>
      <link>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466656#M699485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, after some further testing this was also my conclusion, and eventhough the make date of week 40 is made for 6th day of the week, the Weekname function transfers it into the same timestamp as the month. My first assumption was that it would only convert the part where the classification was true, but as soon as the timestamp have been converted,it sticks eventhough the same timestamp may appear as week as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution was to make a text representation as well, a bit more complex but it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 13:34:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466656#M699485</guid>
      <dc:creator>skovsgaard</dc:creator>
      <dc:date>2012-11-28T13:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script function Weekname returns a monthname</title>
      <link>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466657#M699486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;... eventhough the make date of week 40 is made for 6th day of the week, the Weekname function transfers it into the same timestamp as the month.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You can also use a &lt;EM&gt;weekoffset &lt;/EM&gt;argument with Weekname() function, similar to MakeWeekDate(). Please check the HELP if this is of any interest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 13:39:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-function-Weekname-returns-a-monthname/m-p/466657#M699486</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-11-28T13:39:22Z</dc:date>
    </item>
  </channel>
</rss>

