<?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: Using an expression defined in a table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-an-expression-defined-in-a-table/m-p/886464#M996397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A solution with pick and match could be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Pick(Match(Metric, 'A', 'B'), sum(A_Measure1) / sum (A_Measure2), sum(B_Measure1) / sum (B_Measure2))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2015 21:27:02 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-06-23T21:27:02Z</dc:date>
    <item>
      <title>Using an expression defined in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-an-expression-defined-in-a-table/m-p/886463#M996396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given a table that has a metric and a goal, and two other tables that contain some data to compute against&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say for metric A I need data from results A and for metric B I need data from result B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I am able to do this with an if statement. Something like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;if(Metric = 'A',&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;sum(A_Measure1) / sum (A_Measure2),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;if(Metric = 'B',&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;sum(B_Measure1) / sum (B_Measure2)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to figure out if there is a way to more dynamically do this instead of a huge if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe have the metric table have the expression embedded somehow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or at least a match statement of some sort?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 21:07:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-an-expression-defined-in-a-table/m-p/886463#M996396</guid>
      <dc:creator>mellerbeck</dc:creator>
      <dc:date>2015-06-23T21:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression defined in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-an-expression-defined-in-a-table/m-p/886464#M996397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A solution with pick and match could be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Pick(Match(Metric, 'A', 'B'), sum(A_Measure1) / sum (A_Measure2), sum(B_Measure1) / sum (B_Measure2))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 21:27:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-an-expression-defined-in-a-table/m-p/886464#M996397</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-23T21:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression defined in a table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-an-expression-defined-in-a-table/m-p/886465#M996398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So in trying to make it more dynamic I concatenated all the metric name and metric definitions into variables and used them in the pick and match. Still wish there was a way to do this more built in...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2015 17:31:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-an-expression-defined-in-a-table/m-p/886465#M996398</guid>
      <dc:creator>mellerbeck</dc:creator>
      <dc:date>2015-06-24T17:31:45Z</dc:date>
    </item>
  </channel>
</rss>

