<?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: Valuelist , pick match and if in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903452#M74523</link>
    <description>&lt;P&gt;Thanks for your reply. it still doesnt work. Is aggregate the problem. For second and third exp I am getting -100% while for first its correct as 7.4%&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 10:11:13 GMT</pubDate>
    <dc:creator>niranjana</dc:creator>
    <dc:date>2022-03-10T10:11:13Z</dc:date>
    <item>
      <title>Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903386#M74512</link>
      <description>&lt;P&gt;Hi , I have written and "If " expression inside Valuelist&amp;nbsp; function, but the first expression is working fine but second expression and third is not working. Also, they are working fine in separate text boxes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dimension is :&amp;nbsp;Valuelist('Total Market','ONC Market','NVS Onco')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expression is :&lt;/P&gt;
&lt;P&gt;if(Valuelist('Total Market','ONC Market','NVS Onco')='Total Market',&lt;/P&gt;
&lt;P&gt;(((sum(aggr(((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "}&amp;gt;}TL_Value))&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "}&amp;gt;}Units_Value),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;/&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "}&amp;gt;}PrevTL))-1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(Valuelist('Total Market','ONC Market','NVS Onco')='ONC Market',&lt;/P&gt;
&lt;P&gt;(((sum(aggr(((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'}&amp;gt;}TL_Value))&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'}&amp;gt;}Units_Value),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'}&amp;gt;}PrevTL))-1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;if(Valuelist('Total Market','ONC Market','NVS Onco')='NVS Onco',&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(((sum(aggr(((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}TL_Value))&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}PrevTL))-1&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 08:04:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903386#M74512</guid>
      <dc:creator>niranjana</dc:creator>
      <dc:date>2022-03-10T08:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903419#M74515</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;&lt;BR /&gt;are you using a low of "(" [parentheses] , make sure you close&amp;nbsp; all they to make it work, i suggest you to use Visual studio or similar software tool to check&amp;nbsp; this cases, check if works now, because all the if was not have the&amp;nbsp;parentheses closed.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if
  (
    Valuelist('Total Market','ONC Market','NVS Onco')='Total Market',
    (
     (
       (
        sum(
           aggr( 
                 (
                    (Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "}&amp;gt;}TL_Value))
                                                    /       
                     Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "}&amp;gt;}Units_Value)
                 )
                                                    *
                    Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "}&amp;gt;}Units_Value)
                ,Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj]
               )
            )

                                                    /
                    Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "}&amp;gt;}PrevTL)
        ) 
      )
    )
    
    -1,

if(Valuelist('Total Market','ONC Market','NVS Onco')='ONC Market',
  (
    (
      (sum(
           aggr(
                 (
                  (Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'}&amp;gt;}TL_Value))
            
                                                                         /
                    Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'}&amp;gt;}Units_Value)
                 )
                                                                         *
                    Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'}&amp;gt;}Units_Value)
                ,Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj]
                )
            )
       )
                                                                        /
                    Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'}&amp;gt;}PrevTL)
    )
    )-1,

if(Valuelist('Total Market','ONC Market','NVS Onco')='NVS Onco',
 (
  (
   (sum(
        aggr(
             (
              (Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}TL_Value))
                                                                        /
               Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value)
             )
                                                                        *
               Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value)
            ,Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])
        )
    )
                                                                        /
              Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}PrevTL)
   )-1
)
)
)
)

 &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 09:33:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903419#M74515</guid>
      <dc:creator>srchagas</dc:creator>
      <dc:date>2022-03-10T09:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903452#M74523</link>
      <description>&lt;P&gt;Thanks for your reply. it still doesnt work. Is aggregate the problem. For second and third exp I am getting -100% while for first its correct as 7.4%&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 10:11:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903452#M74523</guid>
      <dc:creator>niranjana</dc:creator>
      <dc:date>2022-03-10T10:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903460#M74524</link>
      <description>&lt;P&gt;Your problem is probably the combination of a valuelist() as dimension and the call of aggr() within the if-loops. Just for testing replace these aggr() with any simple sum() or count() to see that the&amp;nbsp;construct will work principally.&lt;/P&gt;
&lt;P&gt;That's not worked with the aggr() is caused from the fact that the valuelist() dimension is missing within the dimensions of the aggr(). But you couldn't place it there because only native existing dimensions will be accepted on this place. To bypass this restriction you could just transfer the logic into the script by creating the artificial dimensions there within an island-table maybe with a small inline-load like:&lt;/P&gt;
&lt;P&gt;t: load * inline [&lt;BR /&gt;F&lt;BR /&gt;a&lt;BR /&gt;b&lt;BR /&gt;c&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 10:15:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903460#M74524</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-03-10T10:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903492#M74530</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for you reply. I tried inline as well.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anything wrong with my expression. Should I remove aggregate ? but without that i am not getting correct value in text box.&lt;/P&gt;
&lt;P&gt;Market_Inline:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Market_Inl&lt;BR /&gt;Total Market&lt;BR /&gt;ONC Market&lt;BR /&gt;NVS Onco&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and my expression was&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=Pick(Match(Market_Inl,'Total Market','ONC Market','NVS Onco'),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(((sum(aggr(((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'}&amp;gt;}TL_Value))&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'}&amp;gt;}Units_Value),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;+&lt;/P&gt;
&lt;P&gt;sum(aggr(if( sum({&amp;lt;Year={"$(=Year(Max(Date))-2)"},Month={"&amp;lt;=$(=Num(Month(Max(Date))))"},flag={'Onco'}&amp;gt;}Units_Value)=0,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'}&amp;gt;}TL_Value)&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY'))"},flag={'Onco'}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY'))"},flag={'Onco'}&amp;gt;}Units_Value)),0),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;/&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'}&amp;gt;}PrevTL))-1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;(((sum(aggr(((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "}&amp;gt;}TL_Value))&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "}&amp;gt;}Units_Value),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;+&lt;/P&gt;
&lt;P&gt;sum(aggr(if( sum({&amp;lt;Year={"$(=Year(Max(Date))-2)"},Month={"&amp;lt;=$(=Num(Month(Max(Date))))"}&amp;gt;}Units_Value)=0,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "}&amp;gt;}TL_Value)&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY'))"}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY'))"}&amp;gt;}Units_Value)),0),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;/&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "}&amp;gt;}PrevTL))-1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(((sum(aggr(((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}TL_Value))&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-2),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-2),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;+&lt;/P&gt;
&lt;P&gt;sum(aggr(if( sum({&amp;lt;Year={"$(=Year(Max(Date))-2)"},Month={"&amp;lt;=$(=Num(Month(Max(Date))))"},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value)=0,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;((Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}TL_Value)&lt;BR /&gt;/&lt;BR /&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY'))"},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value))*&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY'))"},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value)),0),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj])))&lt;/P&gt;
&lt;P&gt;/&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY')) "},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}PrevTL))-1&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 11:07:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903492#M74530</guid>
      <dc:creator>niranjana</dc:creator>
      <dc:date>2022-03-10T11:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903521#M74533</link>
      <description>&lt;P&gt;I think your approach is too complex. Not from a technically point of view else from the handling during the development and a later documentation to enable a general maintaining.&lt;/P&gt;
&lt;P&gt;Of course it's not impossible to use such expressions but to detect here any logically and/or syntax mistakes and/or data-related issues could become quite hard.&lt;/P&gt;
&lt;P&gt;Therefore I suggest to simplify the approach. For example by removing the entire set analysis at first - maybe also the aggr() parts because you need an overview if all branches return a value. This ensured that there are no syntax issues. Then you could check if the results return the expected (in regard to no set analysis) values which cleared if all brackets within a branch are set to ensure the right order of execution. After that you will also see if you really need the aggr()&amp;nbsp; because this feature is often not mandatory necessary. And at last you add the set analysis again.&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 12:08:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903521#M74533</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-03-10T12:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903565#M74535</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;
&lt;P&gt;Without aggregation, i am not getting the correct value. Also is it possible to us e NO distinct? If yes, where?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;niranjana&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 13:20:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903565#M74535</guid>
      <dc:creator>niranjana</dc:creator>
      <dc:date>2022-03-10T13:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903587#M74536</link>
      <description>&lt;P&gt;The final results are irrelevant - at least at the beginning. Here it's important that the syntax and the branching and the main-logic within them is working and then step by step more logic and conditions could be added and checked and so on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within your expression are hundreds of possibilities which might cause a wrong result or an error, like missing or too much brackets and quotes, a wrong execution order with your operators, missing/wrong dimensions within the aggr(), wrong formatting and many more reasons. Therefore my suggestion from above to solve the issue with a systematically approach - just with trial and error caused usually much more pain ...&lt;/P&gt;
&lt;P&gt;An expression should provide at the first glance the information what's going on. If you need to scroll between dozens of lines and to&amp;nbsp;disassemble multiple parts again and again - it's too complex. Maybe the set analysis and the expression-parts could be simplified with (parametrized) variables ...&lt;/P&gt;
&lt;P&gt;Beside this NODISTINCT could be in general applied but usually it make the things not easier else the opposite happens.&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 13:54:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1903587#M74536</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-03-10T13:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Valuelist , pick match and if</title>
      <link>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1904057#M74566</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;
&lt;P&gt;Thanks a lot for your explanation!! I know the expression is long. But I found a roundabout way. I added an inline table for markets as shown above. Also in the expression , I added the inline dimension in aggregate function apart from other dimensions. And I got the result.&lt;/P&gt;
&lt;P&gt;i.e.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sum({&amp;lt;Date={"&amp;gt;=$(=Date(Addyears(YEarstart(Max(Date)),-1),'MMM/YY')) &amp;lt;=$(=Date(Addyears(YEarend(Max(Date)),-1),'MMM/YY'))"},flag={'Onco'},Distributor={'NOVARTIS'}&amp;gt;}Units_Value)),0),Product,Pack,Distributor,ATC4,[Ret/Hosp],[Oral/Inj],&lt;STRONG&gt;Market_Inl&lt;/STRONG&gt;)))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 12:18:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Valuelist-pick-match-and-if/m-p/1904057#M74566</guid>
      <dc:creator>niranjana</dc:creator>
      <dc:date>2022-03-11T12:18:17Z</dc:date>
    </item>
  </channel>
</rss>

