<?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: Reusable Calculation Rule and SET Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146416#M900954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this Expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Field4={'&amp;gt;$(=VariableCalc)'}&amp;gt;}Value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jul 2016 10:57:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-07-13T10:57:43Z</dc:date>
    <item>
      <title>Reusable Calculation Rule and SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146415#M900953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will need certain calculation rules in my application:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. if(Variable1=1 AND Field1='ABC', ValueField1, if(Variable2=1 And Field2=1, ValueField2),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This calculation will be used in tables and also I would like to use the same rule in SET Analysis when building charts. So I want to store this rule in a variable using the variable dialogue e.g. VariableCalc =if(Variable1=1 AND Field1='ABC', ValueField1, if(Variable2=1 And Field2=1, ValueField2),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I now use the variable in a SET Analysis Expression it does not calculate. For instance I wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Field4=&amp;gt;VariableCalc) or Sum({&amp;lt;Field4=&amp;gt;$(VariableCalc))&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;gt; Should calculate the sum and ignore selected values in Field4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I put the if Statement directly in the SET Analysis it calculates. The SET Analysis would then look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Field4=&amp;gt;if(Variable1=1 AND Field1='ABC', ValueField1, if(Variable2=1 And Field2=1, ValueField2),0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how do I have to store the calculation rules in order to reuse it in tables and charts and how do I correctly use them. I found a couple of documents dealing with SET Analysis and variables but most of them refer to use variables in the dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!!!&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/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146415#M900953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Calculation Rule and SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146416#M900954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this Expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Field4={'&amp;gt;$(=VariableCalc)'}&amp;gt;}Value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 10:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146416#M900954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-13T10:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Calculation Rule and SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146417#M900955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Missing curly brace perhaps: Sum({&amp;lt;Field4=&amp;gt;&lt;STRONG&gt;}&lt;/STRONG&gt;$(VariableCalc)) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 10:59:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146417#M900955</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-07-13T10:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Calculation Rule and SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146418#M900956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hint with the curly brackets. I correctly set them. I just missed them in the post. So my SET Analysis using the variable would look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Field4=&amp;gt;}VariableCalc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it is still not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 11:03:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146418#M900956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-13T11:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Calculation Rule and SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146419#M900957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post a small qlikview document with some example data that makes clear what you're trying to do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 11:29:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146419#M900957</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-07-13T11:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Calculation Rule and SET Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146420#M900958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I have checked again with your proposal. And it now works fine. I had to take the = away in the variable definition and then using the $() around the variable in the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 11:34:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Calculation-Rule-and-SET-Analysis/m-p/1146420#M900958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-13T11:34:26Z</dc:date>
    </item>
  </channel>
</rss>

