<?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: Reducing if else statements through calculation dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397846#M424137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think this is possible because dollar sign expansion only take places once per chart... and since CalcDim takes two values without selection, this approach will only work when only one possible value of CalcDim is there... otherwise you will have to use either if or Pick() function approach here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Nov 2017 16:02:18 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-11-29T16:02:18Z</dc:date>
    <item>
      <title>Reducing if else statements through calculation dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397845#M424136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to develop a method to save on if else statements by creating a dimension which will contain the calculation and it will be linked to dimension which is present in my chart. As an example , my&amp;nbsp; dataset is below and &lt;SPAN style="font-size: 13.3333px;"&gt;my calculation dimension is below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[ Product, Year, Sale&lt;/P&gt;&lt;P&gt;A, 2013, 10&lt;/P&gt;&lt;P&gt;A, 2014, 20&lt;/P&gt;&lt;P&gt;B, 2013, 40&lt;/P&gt;&lt;P&gt;B, 2014, 50&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calc:&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[Product, CalcDim&lt;/P&gt;&lt;P&gt;A, sum(Sale)&lt;/P&gt;&lt;P&gt;B, avg(Sale)&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my chart i have product and expression which will change according to the product through calcdim dimension. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't been able to achieve it, as I think while evaluating the calcdim in expression, qlikview is not taking in account the dimension corresponding to the row in chart hence that is why it works if I select a single product but not when there are multiple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest some ways, I can accomplish the same , if possible ? Sample qvw is attached. !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397845#M424136</guid>
      <dc:creator>abe786</dc:creator>
      <dc:date>2017-11-29T15:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reducing if else statements through calculation dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397846#M424137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think this is possible because dollar sign expansion only take places once per chart... and since CalcDim takes two values without selection, this approach will only work when only one possible value of CalcDim is there... otherwise you will have to use either if or Pick() function approach here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 16:02:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397846#M424137</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-29T16:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reducing if else statements through calculation dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397847#M424138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not optimum, but I guess this is what you can do&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pick(Match(Product, 'A', 'B'), Sum(Sale), Avg(Sale))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 16:03:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397847#M424138</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-29T16:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reducing if else statements through calculation dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397848#M424139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried with your sample using the replace function but as Sunny said, ran into $ expansion issues.&lt;/P&gt;&lt;P&gt;I have a similar requirement to create a Global Variable that can be used against every metric.It would be cool if anyone has any ideas or a different approach to the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 20:01:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reducing-if-else-statements-through-calculation-dimension/m-p/1397848#M424139</guid>
      <dc:creator>srik00001</dc:creator>
      <dc:date>2017-11-29T20:01:38Z</dc:date>
    </item>
  </channel>
</rss>

