<?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 Unable to use alternate state  or filter the dimension while using set analysis for previous calendar / fiscal year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Unable-to-use-alternate-state-or-filter-the-dimension-while/m-p/127031#M759228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Sample data set :&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;TABLE border="1px" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="font-size: 13.3333px; border-width: 1px; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;Distributor&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2018-2019&lt;BR /&gt; Value&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2017-2018&lt;BR /&gt; Value&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2018-2019&lt;BR /&gt; Value Contribution&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2017-2018&lt;BR /&gt; Value Contribution&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;a&lt;/TD&gt;&lt;TD class="xl65"&gt;6,666.0&lt;/TD&gt;&lt;TD class="xl66"&gt;567.0&lt;/TD&gt;&lt;TD class="xl67"&gt;9.1%&lt;/TD&gt;&lt;TD class="xl68"&gt;3.1%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl72" height="41"&gt;&lt;STRONG style="color: #ff0000;"&gt;ABC&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl73"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;4,563.0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl74"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;5,432.0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl67"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;6.2%&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl68"&gt;&lt;STRONG style="color: #ff0000;"&gt;29.8%&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;c&lt;/TD&gt;&lt;TD class="xl65"&gt;1,111.0&lt;/TD&gt;&lt;TD class="xl66"&gt;789.0&lt;/TD&gt;&lt;TD class="xl67"&gt;1.5%&lt;/TD&gt;&lt;TD class="xl68"&gt;4.3%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;d&lt;/TD&gt;&lt;TD class="xl65"&gt;2,222.0&lt;/TD&gt;&lt;TD class="xl66"&gt;987.0&lt;/TD&gt;&lt;TD class="xl67"&gt;3.0%&lt;/TD&gt;&lt;TD class="xl68"&gt;5.4%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;f&lt;/TD&gt;&lt;TD class="xl65"&gt;3,333.0&lt;/TD&gt;&lt;TD class="xl69"&gt;563.0&lt;/TD&gt;&lt;TD class="xl67"&gt;4.5%&lt;/TD&gt;&lt;TD class="xl68"&gt;3.1%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;e&lt;/TD&gt;&lt;TD class="xl65"&gt;55,555.0&lt;/TD&gt;&lt;TD class="xl66"&gt;9,871.0&lt;/TD&gt;&lt;TD class="xl67"&gt;75.6%&lt;/TD&gt;&lt;TD class="xl68"&gt;54.2%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;variables&lt;/STRONG&gt; :&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;v_FYear&lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;= if(getselectedcount(FiscalYear)=1,1,0)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;v_Year&lt;/SPAN&gt;=if(getselectedcount(Year)=1,1,0)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-----------------------------------------------------------------&lt;/SPAN&gt;-------------------------------&lt;SPAN style="font-size: 13.3333px;"&gt;-----------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to filter the dimension (Distributor) by using Alternate state or by using the directly using the "Distributor.name " in the if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;SPAN style="text-decoration: underline;"&gt;.METHOD 1 : &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; text-decoration: underline;"&gt;using the directly the "Distributor.name " in the if condition &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 410px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" colspan="2" height="101" rowspan="5" style="border-right: 1.0pt solid black; border-bottom: 1.0pt solid black;" width="410"&gt;=if(Distributor.Name='ABC' and v_Year=1,Sum({$&amp;lt;Year={$(=max(Year)-1)}[Value])/100000 , &lt;BR /&gt; if(Distributor.Name='ABC' and v_FYear=1,sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt; [Value] )/100000,'')&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Below is the screenshot of the output I get :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="syn error .bmp" class="jive-image image-1" src="/legacyfs/online/211933_syn error .bmp" style="height: 277px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;--------------------------------------&lt;SPAN style="font-size: 13.3333px;"&gt;-------------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. &lt;STRONG style="text-decoration: underline;"&gt;METHOD 2 : By using the Alternate State &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt; &lt;STRONG&gt;Alternate_state1&lt;/STRONG&gt; is the list box for the Distributor names&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is syntax that I used&amp;nbsp; for alternate state method to get the previous year value in the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=if(v_Year=1,Sum({$&amp;lt;Year={$(=max(Year)-1)}&amp;gt;}{[Alternate_State1]*$}[Value])/100000,if(v_FYear=1,sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt;} {[&lt;SPAN style="font-size: 13.3333px;"&gt;Alternate_State1&lt;/SPAN&gt;]*$}[Value] )/100000,''))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The above atlernate state method is used to output the previous calendar / fiscal year , but my output shows the Current year instead of Previous year .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Here is syntax that I used&amp;nbsp; for alternate state method to get the previous year share of business in the expression &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;if(v_Year=1 ,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(sum({$&amp;lt;Year={$(=max(Year)-1)}&amp;gt;}{[Alternate_State1]*$}[Value])/sum({$&amp;lt;Year={$(=max(Year)-1)}&amp;gt;}TOTAL[Value])),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(v_FYear=1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt;} {[Alternate_State1]*$}[Value] )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt;} Total[Value] )))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- the above expression calculates current years value / previous year total value which is wrong as I need previous year divided by previous year total&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks in Advance &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Arun &lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>arunqlik2view</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Unable to use alternate state  or filter the dimension while using set analysis for previous calendar / fiscal year</title>
      <link>https://community.qlik.com/t5/QlikView/Unable-to-use-alternate-state-or-filter-the-dimension-while/m-p/127031#M759228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Sample data set :&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;TABLE border="1px" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="font-size: 13.3333px; border-width: 1px; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;Distributor&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2018-2019&lt;BR /&gt; Value&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2017-2018&lt;BR /&gt; Value&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2018-2019&lt;BR /&gt; Value Contribution&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center;"&gt;FY 2017-2018&lt;BR /&gt; Value Contribution&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;a&lt;/TD&gt;&lt;TD class="xl65"&gt;6,666.0&lt;/TD&gt;&lt;TD class="xl66"&gt;567.0&lt;/TD&gt;&lt;TD class="xl67"&gt;9.1%&lt;/TD&gt;&lt;TD class="xl68"&gt;3.1%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl72" height="41"&gt;&lt;STRONG style="color: #ff0000;"&gt;ABC&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl73"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;4,563.0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl74"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;5,432.0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl67"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;6.2%&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl68"&gt;&lt;STRONG style="color: #ff0000;"&gt;29.8%&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;c&lt;/TD&gt;&lt;TD class="xl65"&gt;1,111.0&lt;/TD&gt;&lt;TD class="xl66"&gt;789.0&lt;/TD&gt;&lt;TD class="xl67"&gt;1.5%&lt;/TD&gt;&lt;TD class="xl68"&gt;4.3%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;d&lt;/TD&gt;&lt;TD class="xl65"&gt;2,222.0&lt;/TD&gt;&lt;TD class="xl66"&gt;987.0&lt;/TD&gt;&lt;TD class="xl67"&gt;3.0%&lt;/TD&gt;&lt;TD class="xl68"&gt;5.4%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;f&lt;/TD&gt;&lt;TD class="xl65"&gt;3,333.0&lt;/TD&gt;&lt;TD class="xl69"&gt;563.0&lt;/TD&gt;&lt;TD class="xl67"&gt;4.5%&lt;/TD&gt;&lt;TD class="xl68"&gt;3.1%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17"&gt;e&lt;/TD&gt;&lt;TD class="xl65"&gt;55,555.0&lt;/TD&gt;&lt;TD class="xl66"&gt;9,871.0&lt;/TD&gt;&lt;TD class="xl67"&gt;75.6%&lt;/TD&gt;&lt;TD class="xl68"&gt;54.2%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;variables&lt;/STRONG&gt; :&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;v_FYear&lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;= if(getselectedcount(FiscalYear)=1,1,0)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;v_Year&lt;/SPAN&gt;=if(getselectedcount(Year)=1,1,0)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-----------------------------------------------------------------&lt;/SPAN&gt;-------------------------------&lt;SPAN style="font-size: 13.3333px;"&gt;-----------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to filter the dimension (Distributor) by using Alternate state or by using the directly using the "Distributor.name " in the if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;SPAN style="text-decoration: underline;"&gt;.METHOD 1 : &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; text-decoration: underline;"&gt;using the directly the "Distributor.name " in the if condition &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 410px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" colspan="2" height="101" rowspan="5" style="border-right: 1.0pt solid black; border-bottom: 1.0pt solid black;" width="410"&gt;=if(Distributor.Name='ABC' and v_Year=1,Sum({$&amp;lt;Year={$(=max(Year)-1)}[Value])/100000 , &lt;BR /&gt; if(Distributor.Name='ABC' and v_FYear=1,sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt; [Value] )/100000,'')&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Below is the screenshot of the output I get :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="syn error .bmp" class="jive-image image-1" src="/legacyfs/online/211933_syn error .bmp" style="height: 277px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;--------------------------------------&lt;SPAN style="font-size: 13.3333px;"&gt;-------------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. &lt;STRONG style="text-decoration: underline;"&gt;METHOD 2 : By using the Alternate State &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt; &lt;STRONG&gt;Alternate_state1&lt;/STRONG&gt; is the list box for the Distributor names&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is syntax that I used&amp;nbsp; for alternate state method to get the previous year value in the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=if(v_Year=1,Sum({$&amp;lt;Year={$(=max(Year)-1)}&amp;gt;}{[Alternate_State1]*$}[Value])/100000,if(v_FYear=1,sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt;} {[&lt;SPAN style="font-size: 13.3333px;"&gt;Alternate_State1&lt;/SPAN&gt;]*$}[Value] )/100000,''))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The above atlernate state method is used to output the previous calendar / fiscal year , but my output shows the Current year instead of Previous year .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Here is syntax that I used&amp;nbsp; for alternate state method to get the previous year share of business in the expression &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;if(v_Year=1 ,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(sum({$&amp;lt;Year={$(=max(Year)-1)}&amp;gt;}{[Alternate_State1]*$}[Value])/sum({$&amp;lt;Year={$(=max(Year)-1)}&amp;gt;}TOTAL[Value])),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(v_FYear=1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt;} {[Alternate_State1]*$}[Value] )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/sum({$&amp;lt;[FiscalYear]={"$(=Only((SubField([FiscalYear],'-',1) - 1) &amp;amp; '-' &amp;amp; (SubField([FiscalYear],'-',2) - 1) ))"}&amp;gt;} Total[Value] )))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- the above expression calculates current years value / previous year total value which is wrong as I need previous year divided by previous year total&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks in Advance &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Arun &lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unable-to-use-alternate-state-or-filter-the-dimension-while/m-p/127031#M759228</guid>
      <dc:creator>arunqlik2view</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
  </channel>
</rss>

