<?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: Year,month expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396464#M147829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Thank you all for your suggestion&lt;/P&gt;&lt;P&gt;I have tried all your expression but still its not giving result as per my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narender&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 May 2013 06:33:32 GMT</pubDate>
    <dc:creator>narender123</dc:creator>
    <dc:date>2013-05-23T06:33:32Z</dc:date>
    <item>
      <title>Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396459#M147824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have 2 filters &lt;/P&gt;&lt;P&gt;1) Year&lt;/P&gt;&lt;P&gt;2) Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my expression(1):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Year={$(=max(Year))},Month={$(=MaxString(Month))}&amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so by default it should show the amount of max month of max year.&lt;/P&gt;&lt;P&gt;but it not working &lt;/P&gt;&lt;P&gt;When i select year filter only then it shows the that year max month amount(means working fine)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; expression &lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Year={$(=max(Year))}&amp;gt;}Amount) is working fine.&lt;/P&gt;&lt;P&gt; the problem is that both together (month and year) not showing result bydefault for max(month ) of Max(year).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so anybody can tell me whats is wrong with my expression(1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narender&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:22:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396459#M147824</guid>
      <dc:creator>narender123</dc:creator>
      <dc:date>2013-05-22T13:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396460#M147825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;You probably need to use max instead of maxstring: Month={$(=Max(Month)). But if your month is a real string then you need to change the field or add another field in the script so you can use the month number. The alphabetic order of the month names isn't the right order to find the max month number. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:40:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396460#M147825</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-05-22T13:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396461#M147826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Narender,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Better you create one variable like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for year : vmaxyear = max(year)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; month : vmaxmonth = month(max(date field))&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you call that variable in expression like&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=sum({&amp;lt;Year={$(vmaxyear)},Month={$(vmaxmonth )}&amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;hope it is working&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Nirmal.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396461#M147826</guid>
      <dc:creator />
      <dc:date>2013-05-22T13:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396462#M147827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your Month field is a true string, then, like Gysbert said, it will not return the expected max every time. If you have the actual date field, use the Month() function to calculate the date, and it will be a Dual value (string and number). This might solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you can create your own dual using Dual(String, Number).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another solution... If Month is a string then you should qualify your set analysis for that field. Notice the double quotes added to the Month={"[some_value]"}. This will search for a match or use single quotes for an exact string match.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sum({&amp;lt;Year={$(=max(Year))},Month={&lt;STRONG&gt;"&lt;/STRONG&gt;$(=MaxString(Month))&lt;STRONG&gt;"&lt;/STRONG&gt;}&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:57:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396462#M147827</guid>
      <dc:creator />
      <dc:date>2013-05-22T13:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396463#M147828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just thought of another option...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you always plan to use YEAR and MONTH from a specific transaction date, then you can use MonthName() to create a Month-Year value (again a dual) which makes your set analysis simpler. You can create the field in your script and use the MONTH_YEAR={Max(MONTH_YEAR)} in your set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 13:59:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396463#M147828</guid>
      <dc:creator />
      <dc:date>2013-05-22T13:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396464#M147829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Thank you all for your suggestion&lt;/P&gt;&lt;P&gt;I have tried all your expression but still its not giving result as per my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Narender&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 06:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396464#M147829</guid>
      <dc:creator>narender123</dc:creator>
      <dc:date>2013-05-23T06:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396465#M147830</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 following the steps below and see if helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Create a inline table with Monthname and Monthnumber&lt;/P&gt;&lt;P&gt;2) do a applymap or lookup for the month name in your original table. This will help you to create numbers for each month (1....12)&lt;/P&gt;&lt;P&gt;3) Use the same expression that you have created&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 07:28:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396465#M147830</guid>
      <dc:creator />
      <dc:date>2013-05-23T07:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396466#M147831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=sum({&amp;lt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Month=,&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Year=&lt;/SPAN&gt;,&lt;/SPAN&gt;Year={"$(=max(Year))"},Month={"$(=num(Max(Month)))"}&amp;gt;}Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 07:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396466#M147831</guid>
      <dc:creator>er_mohit</dc:creator>
      <dc:date>2013-05-23T07:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396467#M147832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;I have already created Monthno and connected it with my master calender .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 10:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396467#M147832</guid>
      <dc:creator>narender123</dc:creator>
      <dc:date>2013-05-23T10:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396468#M147833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;But still not working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 10:13:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396468#M147833</guid>
      <dc:creator>narender123</dc:creator>
      <dc:date>2013-05-23T10:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Year,month expression</title>
      <link>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396469#M147834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide us with an example QVW? I think we would be able to solve your problem faster with your specific example - with just the calendar and fake data for Amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you try er.mohit's example above. I would remove the double quotes since you don't need to search for the number. Also, you don't need to ignore the selections and then redefine year and month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=Sum({&amp;lt;Month=&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Year={$(=Max(Year))},&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Monthno&lt;/SPAN&gt;={$(=Max(&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Monthno&lt;/SPAN&gt;))}&amp;gt;} Amount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached example.&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 12:40:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Year-month-expression/m-p/396469#M147834</guid>
      <dc:creator />
      <dc:date>2013-05-23T12:40:59Z</dc:date>
    </item>
  </channel>
</rss>

