<?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 Transforming a data into a weeknumber in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163594#M462798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a column called "OFF_SWITCH_DAT" with date that looks like this: DD-MM-YYYY HH:MM:SS (like this: 4-1-2016 17:48:50). What I would like to do now is transform this value into a weeknumber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;OFF_SWITCH_DAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),'-') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekNum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;But this gives me the following output:&lt;/SPAN&gt;&lt;/P&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;SPAN style="font-size: 10pt;"&gt;Also&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;OFF_SWITCH_DAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekNum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Does not work (giving me 2016/04)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Any thougts on how I can get a weeknumber.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Aug 2016 11:55:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-24T11:55:53Z</dc:date>
    <item>
      <title>Transforming a data into a weeknumber</title>
      <link>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163594#M462798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a column called "OFF_SWITCH_DAT" with date that looks like this: DD-MM-YYYY HH:MM:SS (like this: 4-1-2016 17:48:50). What I would like to do now is transform this value into a weeknumber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;OFF_SWITCH_DAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),'-') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekNum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;But this gives me the following output:&lt;/SPAN&gt;&lt;/P&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;SPAN style="font-size: 10pt;"&gt;Also&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;OFF_SWITCH_DAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekNum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Does not work (giving me 2016/04)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Any thougts on how I can get a weeknumber.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 11:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163594#M462798</guid>
      <dc:creator />
      <dc:date>2016-08-24T11:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming a data into a weeknumber</title>
      <link>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163595#M462799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use this Expression and define your datefield instead of hardcoded date&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;weekname&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;timestamp#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('4-1-2016 17:48:50','DD-MM-YYYY hh:mm:ss')) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/135424_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 12:00:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163595#M462799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T12:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming a data into a weeknumber</title>
      <link>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163596#M462800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Num(Week(YourDateField))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=weekname(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;YourDateField&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 12:02:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163596#M462800</guid>
      <dc:creator>santiago_respane</dc:creator>
      <dc:date>2016-08-24T12:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming a data into a weeknumber</title>
      <link>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163597#M462801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First make sure that the OFF_SWITCH_DAT is being correctly loaded as a numeric date value. The easiest way to check is to create a list box for &lt;SPAN style="font-size: 13.3333330154419px;"&gt;OFF_SWITCH_DAT and seeing whether the dates align to the left (string) or right (numeric date), or a mix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can get a Week number with Week(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;OFF_SWITCH_DAT), or a week/year name with WeekName(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;OFF_SWITCH_DAT).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 12:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163597#M462801</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2016-08-24T12:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming a data into a weeknumber</title>
      <link>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163598#M462802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As suggested above the most likely reason is that the timestamp does not have the expected underlying numerical value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the incoming format is the same as your expected format in the app, I would suggest that you setup the app format variables to match the expected output. This should minimize your need for additional formatting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your example format string, I noticed that you use capital letters for the time. Try altering the format variables to lower case for the time portion. For consistency, make sure all three variables are aligned format wise. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET TimeFormat='hh:mm:ss';&lt;/P&gt;&lt;P&gt;SET DateFormat='&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD-MM-YYYY &lt;/SPAN&gt;';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD-MM-YYYY &lt;/SPAN&gt; hh:mm:ss';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Aug 2016 22:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163598#M462802</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2016-08-28T22:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming a data into a weeknumber</title>
      <link>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163599#M462803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try This &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WeekName(Floor(Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;OFF_SWITCH_DAT))).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Aug 2016 23:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Transforming-a-data-into-a-weeknumber/m-p/1163599#M462803</guid>
      <dc:creator>rupamjyotidas</dc:creator>
      <dc:date>2016-08-28T23:35:14Z</dc:date>
    </item>
  </channel>
</rss>

