<?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: Help with using functions within an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015605#M640166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have date field in your database? I would suggest using Dates instead of YearWeek to do this kind of stuff as it gets complicated when its beginning of a new year and going back becomes an issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2016 18:23:21 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-01-29T18:23:21Z</dc:date>
    <item>
      <title>Help with using functions within an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015604#M640165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;I wondered if someone can help with the below function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-indent: 36.0pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;[WeekPeriod]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt; ={&amp;lt;=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial','sans-serif';"&gt;$(Year(today())&amp;amp;num(week(Today())+1,'00'))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;[Value To Make]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;I have a field called WeekPeriod which is name up of Year and Week number e.g. 2001604 is year 2016 week 04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;I also have a “Value to make” column which contains values I want to sum up.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;What I’m trying to do is sum up all values in “Value To Make” which are before this week (less than 201604)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;I can’t seem to get the logic correct though.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;Any help would be appreciated&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;Cheers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 15:49:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015604#M640165</guid>
      <dc:creator>chris1987</dc:creator>
      <dc:date>2016-01-29T15:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with using functions within an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015605#M640166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have date field in your database? I would suggest using Dates instead of YearWeek to do this kind of stuff as it gets complicated when its beginning of a new year and going back becomes an issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 18:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015605#M640166</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-01-29T18:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with using functions within an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015606#M640167</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="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;[WeekPeriod]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt; ={"&amp;lt;=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial','sans-serif';"&gt;$(=Year(today())&amp;amp;num(week(Today())+1,'00'))"&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: maroon;"&gt;[Value To Make]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;Why do you add 1 to today's week?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 18:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015606#M640167</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-01-29T18:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with using functions within an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015607#M640168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;May be like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14540924378656427 jive_text_macro" jivemacro_uid="_14540924378656427" modifiedtitle="true"&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;Mid(WeekPeriod,6,6) as Week,&lt;/P&gt;
&lt;P&gt;Mid(WeekPeriod,1,4) as year&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WeekPeriod, Value to make&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201601, 868&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201602, 88&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201603, 777&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201604, 75&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By using this at front end,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="WeekYear.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/113044_WeekYear.PNG" style="height: 232px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14540925588837490 jive_text_macro" jivemacro_uid="_14540925588837490"&gt;
&lt;P&gt;=Sum({&amp;lt;Year={"$(=Max(Year))"},Week={"&amp;lt;$(=Week(Today()))"}&amp;gt;}[Value to make])&lt;/P&gt;
&lt;/PRE&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14540925076776082" jivemacro_uid="_14540925076776082" modifiedtitle="true"&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;BR /&gt;PFA,&lt;/P&gt;&lt;P&gt;Hirish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 18:37:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015607#M640168</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2016-01-29T18:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with using functions within an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015608#M640169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. I added +1 to the weeknumber as a quickfix as I'm just testing a few reports in Qlikview. On our system if you go to excel and put in =weeknum(today()) I was getting week 5, but getting Week 4 in Qlikview? I don't know if this was just our system but as the report is in development I didn't look too much into it, I was focusing on the main function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2016 08:15:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015608#M640169</guid>
      <dc:creator>chris1987</dc:creator>
      <dc:date>2016-02-01T08:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with using functions within an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015609#M640170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Week 5 started today, Feb 1st. QV uses ISO standard week numbering, which calendar system are you using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this blog posts are of interest:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3545"&gt;Redefining the Week Numbers&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3527"&gt;Redefining the Week Start&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also note that today() with default timer mode returns the date when the document was opened:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor476"&gt;&lt;/A&gt;&lt;A name="today"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;&lt;EM&gt;&lt;STRONG&gt;today(&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN class="Italic"&gt;[timer_mode]&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt; )&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Returns the current date from the system clock. The &lt;SPAN class="Italic"&gt;timer_mode&lt;/SPAN&gt; may have the following values:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;0 Date at script run&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;1 Date at function call&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;2 Date when the document was opened&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Default &lt;SPAN class="Italic"&gt;timer_mode&lt;/SPAN&gt; is 2. The &lt;SPAN class="Italic"&gt;timer_mode = 1&lt;/SPAN&gt; should be used with caution, since it polls the operating system every second and hence could slow down the system. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Besides this, does the changed dollar sign expansion (adding the leading equal sign) works out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2016 09:36:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-using-functions-within-an-expression/m-p/1015609#M640170</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-01T09:36:07Z</dc:date>
    </item>
  </channel>
</rss>

