<?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: Set Analysis with nested Replace function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752813#M57995</link>
    <description>&lt;P&gt;Thanks for your help - this doesn't cause an error but it just returns zero values for every row of the table.&lt;/P&gt;&lt;P&gt;I've decided to go another way and used LIKE to test whether or not TM1_Account contains "YTD".&amp;nbsp; If it does, I'm simply returning zero.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2020 12:56:18 GMT</pubDate>
    <dc:creator>njimack</dc:creator>
    <dc:date>2020-10-15T12:56:18Z</dc:date>
    <item>
      <title>Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752519#M57976</link>
      <description>&lt;P&gt;The below code is giving me the following error: "Error in set modifier ad hoc element list. ',' or ')' expected.&lt;/P&gt;&lt;P&gt;I think it's because of the Replace function, so my question is, do I have the syntax wrong, or is there a better way of doing this.&lt;/P&gt;&lt;P&gt;This expression is to be used in a table - if TM1_Account contains the string "YTD", then I want the expression to be calculated using "MTD".&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;=if(Account_Category = 'Revenue',&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; sum({&amp;lt;IsInYTD = {1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; CYTDFlag = {1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; Version = {'Actual'}&amp;gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; (Amount))/1000000,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if(Account_Category = 'PE Balance Sheet',&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;IsInYTD= {1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CYTDFlag = {1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsCurrentMonth = {1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version = {'Actual'}&amp;gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Amount)))/1000000000,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;IsInYTD={1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CYTDFlag={1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsCurrentMonth={1},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TM1_Account={Replace(TM1_Account,'YTD','MTD')},&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version = {'Actual'}&amp;gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Amount))/1000000000)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 16:16:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752519#M57976</guid>
      <dc:creator>njimack</dc:creator>
      <dc:date>2020-10-14T16:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752581#M57981</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/126748"&gt;@njimack&lt;/a&gt;&amp;nbsp; try this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;=if(Account_Category = 'Revenue',

  sum({&amp;lt;IsInYTD = {1},

  CYTDFlag = {1},

  Version = {'Actual'}&amp;gt;}

  (Amount))/1000000,

 

if(Account_Category = 'PE Balance Sheet',

                sum({&amp;lt;IsInYTD= {1},

    CYTDFlag = {1},

    IsCurrentMonth = {1},

    Version = {'Actual'}&amp;gt;}

    (Amount))/1000000000,

   

    sum({&amp;lt;IsInYTD={1},

    CYTDFlag={1},

    IsCurrentMonth={1},

    TM1_Account={Replace(TM1_Account,'YTD','MTD')},

    Version = {'Actual'}&amp;gt;}

    (Amount))/1000000000))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 20:59:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752581#M57981</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-10-14T20:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752690#M57987</link>
      <description>&lt;P&gt;Thanks, but it's still giving me the same error message.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 07:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752690#M57987</guid>
      <dc:creator>njimack</dc:creator>
      <dc:date>2020-10-15T07:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752734#M57992</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/126748"&gt;@njimack&lt;/a&gt;&amp;nbsp;not sure why you need replace here. you can directly call "MTD" instead&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=if(Account_Category = 'Revenue',

  sum({&amp;lt;IsInYTD = {1},

  CYTDFlag = {1},

  Version = {'Actual'}&amp;gt;}

  (Amount))/1000000,

 

if(Account_Category = 'PE Balance Sheet',

                sum({&amp;lt;IsInYTD= {1},

    CYTDFlag = {1},

    IsCurrentMonth = {1},

    Version = {'Actual'}&amp;gt;}

    (Amount)))/1000000000,

   

    sum({&amp;lt;IsInYTD={1},

    CYTDFlag={1},

    IsCurrentMonth={1},

    TM1_Account={'MTD'},

    Version = {'Actual'}&amp;gt;}

    (Amount))/1000000000)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 10:07:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752734#M57992</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-15T10:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752747#M57993</link>
      <description>&lt;P&gt;It's not that simple unfortunately.&amp;nbsp; The account could be one of the below 4 items, and the list of potential accounts might expand over time so I don't want to hard-code anything.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Balance Sheet items, I want the calculation to be performed only on the MTD value, not the YTD value.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Avg Liabilities (MTD)&lt;/LI&gt;&lt;LI&gt;Avg Liabilities (YTD)&lt;/LI&gt;&lt;LI&gt;Avg Assets (MTD)&lt;/LI&gt;&lt;LI&gt;Avg Assets (YTD)&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 15 Oct 2020 10:33:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752747#M57993</guid>
      <dc:creator>njimack</dc:creator>
      <dc:date>2020-10-15T10:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752749#M57994</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/126748"&gt;@njimack&lt;/a&gt;&amp;nbsp; try below then&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=if(Account_Category = 'Revenue',

  sum({&amp;lt;IsInYTD = {1},

  CYTDFlag = {1},

  Version = {'Actual'}&amp;gt;}

  (Amount))/1000000,

 

if(Account_Category = 'PE Balance Sheet',

                sum({&amp;lt;IsInYTD= {1},

    CYTDFlag = {1},

    IsCurrentMonth = {1},

    Version = {'Actual'}&amp;gt;}

    (Amount))/1000000000,

   

    sum({&amp;lt;IsInYTD={1},

    CYTDFlag={1},

    IsCurrentMonth={1},

    TM1_Account={"=Replace(TM1_Account,'YTD','MTD')"},

    Version = {'Actual'}&amp;gt;}

    (Amount))/1000000000))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 Oct 2020 10:40:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752749#M57994</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-15T10:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752813#M57995</link>
      <description>&lt;P&gt;Thanks for your help - this doesn't cause an error but it just returns zero values for every row of the table.&lt;/P&gt;&lt;P&gt;I've decided to go another way and used LIKE to test whether or not TM1_Account contains "YTD".&amp;nbsp; If it does, I'm simply returning zero.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 12:56:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752813#M57995</guid>
      <dc:creator>njimack</dc:creator>
      <dc:date>2020-10-15T12:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752824#M57996</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/126748"&gt;@njimack&lt;/a&gt;&amp;nbsp;how about this... assuming&amp;nbsp; you select a single value in TM1_Account...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=if(Account_Category = 'Revenue',
  Sum({&amp;lt;IsInYTD = {1}, CYTDFlag = {1}, Version = {'Actual'}&amp;gt;} (Amount))/1000000,

if(Account_Category = 'PE Balance Sheet',
  sum({&amp;lt;IsInYTD= {1}, CYTDFlag = {1}, IsCurrentMonth = {1}, Version = {'Actual'}&amp;gt;} (Amount))/1000000000,

    sum({&amp;lt;IsInYTD={1}, CYTDFlag={1}, IsCurrentMonth={1}, TM1_Account={"$(=Replace(TM1_Account,'YTD','MTD'))"}, Version = {'Actual'}&amp;gt;}  (Amount))/1000000000))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 13:08:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752824#M57996</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-10-15T13:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with nested Replace function</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752828#M57997</link>
      <description>&lt;P&gt;hi, you are doing&amp;nbsp; 'if(sum(' , try doing sum( if(' instead.&lt;/P&gt;&lt;P&gt;Or try adding a 'sum(aggr(' grouping all your expression.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 13:15:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-nested-Replace-function/m-p/1752828#M57997</guid>
      <dc:creator>QFabian</dc:creator>
      <dc:date>2020-10-15T13:15:11Z</dc:date>
    </item>
  </channel>
</rss>

