<?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 Variable in Load with Set Analysis expression  or be calculated in LOAD and stored in a Field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Variable-in-Load-with-Set-Analysis-expression-or-be-calculated/m-p/1730729#M55742</link>
    <description>&lt;P&gt;Hi, I doubt how to do this in qlik sense:&lt;/P&gt;&lt;P&gt;My Example Table:&lt;/P&gt;&lt;P&gt;Area&amp;nbsp; | Sales&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500&amp;nbsp;&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a measure to&amp;nbsp; calculate this:&lt;/P&gt;&lt;P&gt;if(Area='A', sum({&amp;lt;Area={"A"}&amp;gt;} Sales)+sum({&amp;lt;Area={"B"}&amp;gt;} Sales),sum(Sales))&lt;/P&gt;&lt;P&gt;In resume, it calculates the value of Sum for A and B when my Area is equal A&lt;BR /&gt;I know how to do something related to it but using the above function&lt;/P&gt;&lt;P&gt;I want to understand how could I manage to do this because any moment that I use&lt;BR /&gt;If (Field = "A", ...)&lt;/P&gt;&lt;P&gt;I can't use any other field values like B or C, it is like a "filter" that limits my calculations for only values in rows that field is equal A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;In google sheets or excel I can work on each cell per time&lt;/P&gt;&lt;P&gt;In cell&amp;nbsp; C2 I'd write&amp;nbsp; &amp;nbsp; =&amp;gt; sumifs(B:B;A:A;"A")+ sumifs(B:B;A:A;"B")&amp;nbsp; or any other variation&lt;/P&gt;&lt;P&gt;In cell C3 and C4 I can use completely independent formulas of C2&lt;/P&gt;&lt;P&gt;In qlik I only can setup the whole column measure value&lt;/P&gt;&lt;P&gt;Yes, I can use pick(match())&lt;/P&gt;&lt;P&gt;but again if "matches" it also filters&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(Area='A', sum({&amp;lt;Area={"A"}&amp;gt;} Sales)+sum({&amp;lt;Area={"B"}&amp;gt;} Sales),sum(Sales))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Doesn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to create a variable and call the variable, it doesn't work, it calculated the sum(B Sales)=0&lt;/P&gt;&lt;P&gt;What I need is a way of calculating in LOAD and store this variable in a Field&lt;/P&gt;&lt;P&gt;like that :&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;Let vExp2 = 'if(Area='&amp;amp;chr(39)&amp;amp; 'Assembly' &amp;amp;chr(39)&amp;amp;',sum({&amp;lt;Area={"Assembly"}&amp;gt;}Act)+sum({&amp;lt;Area={"Electronics"}&amp;gt;} PP),sum(Sales))';&lt;/P&gt;&lt;P&gt;ALOS:&lt;BR /&gt;Load&lt;BR /&gt;'$(vExp2)' as vALOS&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;But in my table, it writes the whole expression instead of evaluating it and show the value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output that I want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Area&amp;nbsp; | Sales | meausure&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500&amp;nbsp; &amp;nbsp; &amp;nbsp; 1500&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp;1000&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; &amp;nbsp; 100&lt;/P&gt;&lt;P&gt;Yes, I can do in this simple case using the above&lt;/P&gt;&lt;P&gt;But I want to know how to manage this situation in more complexes cases&lt;/P&gt;&lt;P&gt;Are there other ways to manage this, without using the above function?&lt;/P&gt;&lt;P&gt;I think it is and challenge&lt;/P&gt;&lt;P&gt;I wasted more than 20 hours waiting for a solution and nothing worked properly.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 18:18:55 GMT</pubDate>
    <dc:creator>edupitel7</dc:creator>
    <dc:date>2024-11-16T18:18:55Z</dc:date>
    <item>
      <title>Variable in Load with Set Analysis expression  or be calculated in LOAD and stored in a Field</title>
      <link>https://community.qlik.com/t5/App-Development/Variable-in-Load-with-Set-Analysis-expression-or-be-calculated/m-p/1730729#M55742</link>
      <description>&lt;P&gt;Hi, I doubt how to do this in qlik sense:&lt;/P&gt;&lt;P&gt;My Example Table:&lt;/P&gt;&lt;P&gt;Area&amp;nbsp; | Sales&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500&amp;nbsp;&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a measure to&amp;nbsp; calculate this:&lt;/P&gt;&lt;P&gt;if(Area='A', sum({&amp;lt;Area={"A"}&amp;gt;} Sales)+sum({&amp;lt;Area={"B"}&amp;gt;} Sales),sum(Sales))&lt;/P&gt;&lt;P&gt;In resume, it calculates the value of Sum for A and B when my Area is equal A&lt;BR /&gt;I know how to do something related to it but using the above function&lt;/P&gt;&lt;P&gt;I want to understand how could I manage to do this because any moment that I use&lt;BR /&gt;If (Field = "A", ...)&lt;/P&gt;&lt;P&gt;I can't use any other field values like B or C, it is like a "filter" that limits my calculations for only values in rows that field is equal A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;In google sheets or excel I can work on each cell per time&lt;/P&gt;&lt;P&gt;In cell&amp;nbsp; C2 I'd write&amp;nbsp; &amp;nbsp; =&amp;gt; sumifs(B:B;A:A;"A")+ sumifs(B:B;A:A;"B")&amp;nbsp; or any other variation&lt;/P&gt;&lt;P&gt;In cell C3 and C4 I can use completely independent formulas of C2&lt;/P&gt;&lt;P&gt;In qlik I only can setup the whole column measure value&lt;/P&gt;&lt;P&gt;Yes, I can use pick(match())&lt;/P&gt;&lt;P&gt;but again if "matches" it also filters&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(Area='A', sum({&amp;lt;Area={"A"}&amp;gt;} Sales)+sum({&amp;lt;Area={"B"}&amp;gt;} Sales),sum(Sales))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Doesn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to create a variable and call the variable, it doesn't work, it calculated the sum(B Sales)=0&lt;/P&gt;&lt;P&gt;What I need is a way of calculating in LOAD and store this variable in a Field&lt;/P&gt;&lt;P&gt;like that :&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;Let vExp2 = 'if(Area='&amp;amp;chr(39)&amp;amp; 'Assembly' &amp;amp;chr(39)&amp;amp;',sum({&amp;lt;Area={"Assembly"}&amp;gt;}Act)+sum({&amp;lt;Area={"Electronics"}&amp;gt;} PP),sum(Sales))';&lt;/P&gt;&lt;P&gt;ALOS:&lt;BR /&gt;Load&lt;BR /&gt;'$(vExp2)' as vALOS&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;But in my table, it writes the whole expression instead of evaluating it and show the value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output that I want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Area&amp;nbsp; | Sales | meausure&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500&amp;nbsp; &amp;nbsp; &amp;nbsp; 1500&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp;1000&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; &amp;nbsp; 100&lt;/P&gt;&lt;P&gt;Yes, I can do in this simple case using the above&lt;/P&gt;&lt;P&gt;But I want to know how to manage this situation in more complexes cases&lt;/P&gt;&lt;P&gt;Are there other ways to manage this, without using the above function?&lt;/P&gt;&lt;P&gt;I think it is and challenge&lt;/P&gt;&lt;P&gt;I wasted more than 20 hours waiting for a solution and nothing worked properly.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variable-in-Load-with-Set-Analysis-expression-or-be-calculated/m-p/1730729#M55742</guid>
      <dc:creator>edupitel7</dc:creator>
      <dc:date>2024-11-16T18:18:55Z</dc:date>
    </item>
  </channel>
</rss>

