<?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: Variable to determine max Fiscal month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824440#M290441</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how about a max with an IF() to filter down the FiscalMonths ?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max ( if( FiscalYear=vCurFisYr,FiscalMonth) ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Mar 2015 02:27:35 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2015-03-04T02:27:35Z</dc:date>
    <item>
      <title>Variable to determine max Fiscal month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824439#M290440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my detail/fact records, I have a mapping for FiscalYr, and FiscalMonth based on the invoice date (our FY is 11/1 to Oct31)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;To map the Fiscal Month and Year&amp;nbsp; I create a formula from the invoice date to get MMYY&amp;nbsp; //&amp;nbsp; =Month(InvoiceDate)&amp;amp;Right(Year(InvoiceDate),2)&lt;/LI&gt;&lt;LI&gt;I then have table in Excel I Left Join to the fact table to assign a transaction a FYear and FMonth -I am doing this because I use vCurFisYr and vCurFisMo to create my MTD and YTD values.&lt;/LI&gt;&lt;LI&gt;I then set a variable to get Current Fiscal Year&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vCurFisYr=max(FiscalYear)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how do I do this to get the current fiscal month in the current fiscal year.&amp;nbsp;&amp;nbsp;&amp;nbsp; I cannot simply say vCurFisMo=max(FisMo) or it will be 12 every time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like in my script to say something like this:&amp;nbsp; &lt;STRONG&gt; LET vCurFisMo=max(FiscalMonth) WHERE FiscalYear=vCurFisYr&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So I do set analysis on&lt;STRONG&gt; vCurFisYr and vCurFisMo&amp;nbsp; &lt;/STRONG&gt;for my MTD and YTD calcs&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 22:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824439#M290440</guid>
      <dc:creator />
      <dc:date>2015-03-03T22:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to determine max Fiscal month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824440#M290441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how about a max with an IF() to filter down the FiscalMonths ?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max ( if( FiscalYear=vCurFisYr,FiscalMonth) ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 02:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824440#M290441</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-04T02:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to determine max Fiscal month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824441#M290442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Use following&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vCurFisYr = max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FiscalYear);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vCurFisMo = max({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FiscalYear = {"$(vCurFisYr)"}&lt;/SPAN&gt;&amp;gt;}FiscalMonth);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 04:17:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824441#M290442</guid>
      <dc:creator>mukesh24</dc:creator>
      <dc:date>2015-03-04T04:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to determine max Fiscal month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824442#M290443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both of these equations worked but I was unable to get them to work within my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vCurFisYr=max(FisYr);&lt;/P&gt;&lt;P&gt;Let vCurFisMo=max ( if( FisYr=vCurFisYr,FisMo) ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How I did get it to work though is by setting a &lt;STRONG&gt;Trigger&lt;/STRONG&gt; on my &lt;STRONG&gt;Document Properties&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;On Open - External/Set Variable - vCurFisYr = max(FisYr)&lt;/LI&gt;&lt;LI&gt;On Variable Input (vCurFisYr) - External/Set Variable - vCurFisMo=max ( if( FisYr=vCurFisYr,FisMo) )&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I wanted to take it a step further but am just getting a - returned.&amp;nbsp;&amp;nbsp; Each FisMo has a MonthName so I thought I could apply the same logic, but it is not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;On Variable Input (vCurFisMo) - External/Set Variable - vMonthName=If(FisMo=vCurFisMo, MonthName)&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 17:43:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824442#M290443</guid>
      <dc:creator />
      <dc:date>2015-03-04T17:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Variable to determine max Fiscal month</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824443#M290444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try using a 'set' rather than a 'let' when defining the variables in the script.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use $() expansion when you invoke the variable in the UI. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 18:05:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-to-determine-max-Fiscal-month/m-p/824443#M290444</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-04T18:05:04Z</dc:date>
    </item>
  </channel>
</rss>

