<?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: problem with $(=maxdate-30) in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869592#M304069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would try this:&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;sum({&amp;lt;DATE_POS = {"&amp;gt;=$(date(DATE_POS - 30))"}&amp;gt;}Profit)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rogério.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Apr 2015 17:20:20 GMT</pubDate>
    <dc:creator>rogerioqv</dc:creator>
    <dc:date>2015-04-07T17:20:20Z</dc:date>
    <item>
      <title>problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869591#M304068</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;My expression $(maxdate) -30 gives me the date that is 30 days less than the max date. However If I put my expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(=date(maxdate - 30)), it gives me -2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for some reasons, the dollar sign expansion is making some problem that I dont understand. In my set analysis, I want to set my expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14284266369337478" jivemacro_uid="_14284266369337478"&gt;
&lt;P&gt;sum({&amp;lt;DATE_POS = {"&amp;gt;=(date(DATE_POS - 30))"}&amp;gt;}Profit)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it does not seem to work. Can someone please explain what is wrong with my dollar sign expansion expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869591#M304068</guid>
      <dc:creator />
      <dc:date>2015-04-07T17:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869592#M304069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would try this:&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;sum({&amp;lt;DATE_POS = {"&amp;gt;=$(date(DATE_POS - 30))"}&amp;gt;}Profit)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rogério.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:20:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869592#M304069</guid>
      <dc:creator>rogerioqv</dc:creator>
      <dc:date>2015-04-07T17:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869593#M304070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This approach always works for me:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;DATE_POS = {"$(='&amp;gt;=' &amp;amp; date(MaxDate-30))"}&amp;gt;} Profit)&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869593#M304070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-07T17:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869594#M304071</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;Try like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum({&amp;lt;DATE_POS = {"$(&amp;gt;= &amp;amp; date(MaxDate-30))"}&amp;gt;} Profit)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:50:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869594#M304071</guid>
      <dc:creator />
      <dc:date>2015-04-07T17:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869595#M304072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have changed the expression a little but neither of them work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14284302864173125" jivemacro_uid="_14284302864173125"&gt;
&lt;P&gt;sum({&amp;lt;CurYTDFlag = {1}, Month={"$( = &amp;amp; month(max(DATE_POS)))"}&amp;gt;}Profit)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14284302912828306" jivemacro_uid="_14284302912828306"&gt;
&lt;P&gt;sum({&amp;lt;CurYTDFlag = {1}, Month={"$( = month(max(DATE_POS)))"}&amp;gt;}Profit)&lt;/P&gt;
&lt;/PRE&gt;&lt;DIV style="left: 3px; top: 51px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 18:11:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869595#M304072</guid>
      <dc:creator />
      <dc:date>2015-04-07T18:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869596#M304073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(Apparently you never tried my suggestion above.)&lt;/P&gt;&lt;P&gt;After you've changed your logic - your second version is &lt;STRONG&gt;technically&lt;/STRONG&gt; correct, and should work.&amp;nbsp; The reasons that it not working may be:&lt;/P&gt;&lt;P&gt;- CurYTDFlag does not have value 1&lt;/P&gt;&lt;P&gt;- values in the Month field are not the same as the function month(max(DATE_POS)) returns.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 18:29:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869596#M304073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-07T18:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869597#M304074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer. Your suggestions seems to work with dates but I cannot get it working with the month expression. I tried it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14284320584425166 jive_text_macro" jivemacro_uid="_14284320584425166"&gt;
&lt;P&gt;=sum({&amp;lt;Month = {"$(='=' &amp;amp; month(MaxDate-30))"}&amp;gt;} Profit) &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it does not seem to work. I have also removed the CurYTDFlag. Also, both the Month field and the expression seems to be returning mar. The only problem again is with the dollar sign expansion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try it in a text box&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14284320089668854 jive_text_macro" jivemacro_uid="_14284320089668854"&gt;
&lt;P&gt;=month(max(DATE_POS))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it returns mar as a value. However, If try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14284320412518804" jivemacro_uid="_14284320412518804"&gt;
&lt;P&gt;=$(=month(max(DATE_POS)))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It returns nothing&lt;/P&gt;&lt;DIV style="left: 5px; top: 211px;"&gt; &lt;/DIV&gt;&lt;DIV style="left: 5px; top: 228px;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 18:41:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869597#M304074</guid>
      <dc:creator />
      <dc:date>2015-04-07T18:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem with $(=maxdate-30) in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869598#M304075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Typically I test expressions in text boxes as well, but not the $-sign expressions like this&lt;/P&gt;&lt;P&gt;=$(=month(max(DATE_POS))) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I did test this, and it worked:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=sum({&amp;lt;Date=, MonthName = {"$(=month(max(Date)))"}&amp;gt;} Sales) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And it works fine.&amp;nbsp; Field names differs from yours, I have MonthName with values 'Jan' to 'Dec'.&amp;nbsp; And, the "Date=" was necessary because I selected Date and didn't want it to affect the result, just wanted to define the Month by that selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 18:49:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-with-maxdate-30-in-set-analysis/m-p/869598#M304075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-07T18:49:31Z</dc:date>
    </item>
  </channel>
</rss>

