<?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: Fiscal Year Syntax Error in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483899#M101095</link>
    <description>&lt;P&gt;Hi Vegar,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My apologies I missed putting in max while typing the code.&lt;/P&gt;
&lt;P&gt;your code is exactly what I'm using and still get the same response.&lt;/P&gt;
&lt;P&gt;Count({$&amp;lt;[TR_DATE.Fisc.FY_Num]={"=$(=max([TR_DATE.Fisc.FY_Num]))"}&amp;gt;} DISTINCT ID)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="noumanbutt_0-1727413988333.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172211iEED56E1EF129A075/image-size/medium?v=v2&amp;amp;px=400" role="button" title="noumanbutt_0-1727413988333.png" alt="noumanbutt_0-1727413988333.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2024 05:13:34 GMT</pubDate>
    <dc:creator>noumanbutt</dc:creator>
    <dc:date>2024-09-27T05:13:34Z</dc:date>
    <item>
      <title>Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483893#M101093</link>
      <description>&lt;P&gt;I'm using the following code in my script to generate a fiscal year field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LET vFM = 7;&lt;BR /&gt;[Fisc]:&lt;BR /&gt;DECLARE FIELD DEFINITION Tagged ('$date')&lt;BR /&gt;FIELDS&lt;/P&gt;
&lt;P&gt;Dual(Right(YearStart($1,0,vFM),2)&amp;amp;'/'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM)) AS [FiscalYear] Tagged ('$axis', '$year'),&lt;BR /&gt;Num(Dual('FY'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM))) AS [FY_Num],&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;DERIVE FIELDS FROM FIELDS [TR_DATE] USING [Fisc] ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the [FiscalYear] field for plotting and the [FY_NUM] to get max / current year or to sort the data.&lt;/P&gt;
&lt;P&gt;However, If I use it to display in a table it works, but it's not working in set analysis nor does it return value if i use it in the KPI chart to test.&lt;/P&gt;
&lt;P&gt;My Set Analysis code is following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count({$&amp;lt;[TR_DATE.Fisc.FY_Num]={"=$(=([TR_DATE.Fisc.FY_Num]))"}&amp;gt;} DISTINCT ID)&lt;/P&gt;
&lt;P&gt;I get this message in the bottom which is telling me the FY_Num field is not returning the correct value in number format.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="noumanbutt_1-1727410716209.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172209i267B30BC2B3BBF15/image-size/medium?v=v2&amp;amp;px=400" role="button" title="noumanbutt_1-1727410716209.png" alt="noumanbutt_1-1727410716209.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can anyone identify the problem ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 04:20:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483893#M101093</guid>
      <dc:creator>noumanbutt</dc:creator>
      <dc:date>2024-09-27T04:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483895#M101094</link>
      <description>&lt;P&gt;Your dolla expansion needs to reurn a value. Right now it is set to [TR_DATE.Fisc.FY_Num] which is the same thing as only([TR_DATE.Fisc.FY_Num] ). That expression will only return a value if you make selections so that only one value is associated with your selection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider changing your modifier to max() , min().&lt;/P&gt;
&lt;P&gt;Count({$&amp;lt;&lt;/P&gt;
&lt;P&gt;[TR_DATE.Fisc.FY_Num]={"=$(=max([TR_DATE.Fisc.FY_Num]))"}&lt;/P&gt;
&lt;P&gt;&amp;gt;} DISTINCT ID)&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 04:59:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483895#M101094</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2024-09-27T04:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483899#M101095</link>
      <description>&lt;P&gt;Hi Vegar,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My apologies I missed putting in max while typing the code.&lt;/P&gt;
&lt;P&gt;your code is exactly what I'm using and still get the same response.&lt;/P&gt;
&lt;P&gt;Count({$&amp;lt;[TR_DATE.Fisc.FY_Num]={"=$(=max([TR_DATE.Fisc.FY_Num]))"}&amp;gt;} DISTINCT ID)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="noumanbutt_0-1727413988333.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172211iEED56E1EF129A075/image-size/medium?v=v2&amp;amp;px=400" role="button" title="noumanbutt_0-1727413988333.png" alt="noumanbutt_0-1727413988333.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 05:13:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483899#M101095</guid>
      <dc:creator>noumanbutt</dc:creator>
      <dc:date>2024-09-27T05:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483919#M101096</link>
      <description>&lt;P&gt;what is output of&amp;nbsp;&lt;SPAN&gt;=max([TR_DATE.Fisc.FY_Num]) in KPI?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;what is output of TR_DATE.Fisc.FY_Num in Filter pane?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you share screenshot of both ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 06:13:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483919#M101096</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2024-09-27T06:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483921#M101097</link>
      <description>&lt;P&gt;Hi! main issue here seems to be the usage of $(...) syntax in set analysis. This syntax attempts to evaluate an expression and return its value. However, in this context, $(...) might not return a straightforward numeric value, especially when working with derived fields or when the evaluation doesn't happen as expected. Here’s how to approach it:&lt;/P&gt;
&lt;P&gt;First, try simplifying the expression to isolate the issue:&lt;/P&gt;
&lt;P&gt;Ensure FY_Num is correctly returning a numeric value. Try testing it in a text object using:&lt;/P&gt;
&lt;P&gt;=Max([TR_DATE.Fisc.FY_Num])&lt;BR /&gt;This will verify if the FY_Num field is correctly populated with numbers.&lt;BR /&gt;If the above returns a valid number, modify your set analysis to use Max directly rather than a nested evaluation:&lt;/P&gt;
&lt;P&gt;Count({$&amp;lt;[TR_DATE.Fisc.FY_Num]={"$(=Max([TR_DATE.Fisc.FY_Num]))"}&amp;gt;} DISTINCT ID)&lt;/P&gt;
&lt;P&gt;Since the error message suggests a number format issue, make sure the field is recognized as a numeric value. Wrapping the evaluation in the Num() function can help enforce numeric formatting:&lt;BR /&gt;Count({$&amp;lt;[TR_DATE.Fisc.FY_Num]={"$(=Num(Max([TR_DATE.Fisc.FY_Num])))"}&amp;gt;} DISTINCT ID)&lt;BR /&gt;This ensures that the result is correctly treated as a number.&lt;/P&gt;
&lt;P&gt;4. Check Field Naming in Set Analysis&lt;BR /&gt;Ensure that the field reference in the set analysis is correct. Depending on how derived fields are tagged, there might be differences in referencing. Adjust your set analysis field reference to:&lt;BR /&gt;Count({$&amp;lt;[FY_Num]={"$(=Max([FY_Num]))"}&amp;gt;} DISTINCT ID)&lt;BR /&gt;By simplifying the field name directly to [FY_Num] instead of [TR_DATE.Fisc.FY_Num], you avoid potential referencing issues caused by complex names.&lt;/P&gt;
&lt;P&gt;Double-check that the derived fields FiscalYear and FY_Num are properly created and populated in the data model.&lt;BR /&gt;Verify the fiscal year generation script is functioning correctly by examining these fields in a table to ensure they contain the expected numeric values.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 06:47:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483921#M101097</guid>
      <dc:creator>diegozecchini</dc:creator>
      <dc:date>2024-09-27T06:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483965#M101103</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/227937"&gt;@noumanbutt&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly, &lt;STRONG&gt;remove "=" before $ expansion&lt;/STRONG&gt; as highlighted in your expression below. Because that "=" will be treated as part of search string between " ". Hence, when you evaluate max(FY_Num) let's say it is "45292", so your search string will become &lt;STRONG&gt;"=45292".&amp;nbsp;&lt;/STRONG&gt; It interprets it as expression due to "=" sign instead search value, hence it will either return wrong value or blank.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({$&amp;lt;[TR_DATE.Fisc.FY_Num]={"&lt;FONT face="comic sans ms,sans-serif" size="5" color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;$(=([TR_DATE.Fisc.FY_Num]))"}&amp;gt;} DISTINCT ID) &lt;STRONG&gt;// Remove highlighted&amp;nbsp; "=".&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Secondly, you can create your FY_Num field just as following as you already have text representation in [FiscalYear] field.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="comic sans ms,sans-serif"&gt;YearStart($1,0,vFM) AS [FY_Num]&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Now, you can use below expression&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({$&amp;lt;[TR_DATE.Fisc.FY_Num]={"&lt;STRONG&gt;$(=date(max([TR_DATE.Fisc.FY_Num])))&lt;/STRONG&gt;"}&amp;gt;} DISTINCT ID)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2483965#M101103</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-09-27T10:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484234#M101129</link>
      <description>&lt;P&gt;I have changed the variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it gives the same result, with or without max.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="noumanbutt_0-1727676038503.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172297i47C446E1DF7D095F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="noumanbutt_0-1727676038503.png" alt="noumanbutt_0-1727676038503.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 06:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484234#M101129</guid>
      <dc:creator>noumanbutt</dc:creator>
      <dc:date>2024-09-30T06:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484236#M101130</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/82758"&gt;@diegozecchini&lt;/a&gt;&amp;nbsp;you're correct as this field is not returning the correct numeric value or any value at all.&lt;/P&gt;
&lt;P&gt;I haven't made any changes to the script and don't understand how it suddenly has started to return null value after the last update.&lt;/P&gt;
&lt;P&gt;This is the expression as I'm currently using&lt;/P&gt;
&lt;P&gt;Count({$&amp;lt;[EVDAT.Fisc.Year_Num]={"$(=([EVDAT.Fisc.Year_Num]))"}&amp;gt;} DISTINCT ID)&lt;/P&gt;
&lt;P&gt;And the result in the bottom&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="noumanbutt_1-1727676362329.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172298i832BA603317E232F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="noumanbutt_1-1727676362329.png" alt="noumanbutt_1-1727676362329.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Following is the load script for generating calendar values&lt;/P&gt;
&lt;P&gt;LET vFM = 7; // first month of the fiscal year&lt;BR /&gt;[Fisc]:&lt;BR /&gt;DECLARE FIELD DEFINITION Tagged ('$date')&lt;BR /&gt;FIELDS&lt;BR /&gt;Dual(Right(YearStart($1,0,vFM),4)&amp;amp;'-'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM)) AS [Year] Tagged ('$axis', '$year'),&lt;BR /&gt;Num(Dual(Right(YearStart($1,0,vFM),4)&amp;amp;'-'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM))) AS [Year_Num],&lt;BR /&gt;Num(YearStart($1,0,vFM)) AS [FY_Num],&lt;BR /&gt;&lt;BR /&gt;DERIVE FIELDS FROM FIELDS [EVDAT] USING [Fisc] ;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 06:06:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484236#M101130</guid>
      <dc:creator>noumanbutt</dc:creator>
      <dc:date>2024-09-30T06:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484237#M101131</link>
      <description>&lt;P&gt;The problem I believe is that the expression/field "&lt;SPAN&gt;[TR_DATE.Fisc.FY_Num]" is not returning any value which shouldn't be the case ... any suggestions ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 06:07:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484237#M101131</guid>
      <dc:creator>noumanbutt</dc:creator>
      <dc:date>2024-09-30T06:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484239#M101132</link>
      <description>&lt;P&gt;What if you adjust it to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Fisc]:&lt;/P&gt;
&lt;P&gt;DECLARE FIELD DEFINITION Tagged ('$date')&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Parameters&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;vFM = 7&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;FIELDS&lt;/P&gt;
&lt;P&gt;Dual(Right(YearStart($1,0,vFM),4)&amp;amp;'-'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM)) AS [Year] Tagged ('$axis', '$year'),&lt;/P&gt;
&lt;P&gt;Num(Dual(Right(YearStart($1,0,vFM),4)&amp;amp;'-'&amp;amp;(Right(YearStart($1,0,vFM),2)+1), YearStart($1,0,vFM))) AS [Year_Num],&lt;/P&gt;
&lt;P&gt;Num(YearStart($1,0,vFM)) AS [FY_Num],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DERIVE FIELDS FROM FIELDS [EVDAT] USING [Fisc] ;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 06:11:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484239#M101132</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2024-09-30T06:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Fiscal Year Syntax Error</title>
      <link>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484249#M101134</link>
      <description>&lt;P&gt;Much appreciated&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25001"&gt;@Vegar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to everyone who tried to help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/82758"&gt;@diegozecchini&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42758"&gt;@PrashantSangle&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 06:50:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Fiscal-Year-Syntax-Error/m-p/2484249#M101134</guid>
      <dc:creator>noumanbutt</dc:creator>
      <dc:date>2024-09-30T06:50:06Z</dc:date>
    </item>
  </channel>
</rss>

