<?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: Calculate a score based on a matrix with dimensions and conditions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1981235#M80970</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/63606"&gt;@MrBosch&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would personally look at the scripting options for this, you have the data. First thoughts from me, load left join the scores to your fact table. Then resident load, the key and scores for the fact table and drops the scores from the fact table. We now have your fact table and table. Next crosstab the scores table you three fields Key, Score type and score.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then front end you can just SUM(Score), or limit using set expressions {&amp;lt;[Score Type]={'Age'}&amp;gt;}&lt;/P&gt;
&lt;P&gt;Hope this makes sense and helps&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 06:18:02 GMT</pubDate>
    <dc:creator>Mark_Little</dc:creator>
    <dc:date>2022-09-15T06:18:02Z</dc:date>
    <item>
      <title>Calculate a score based on a matrix with dimensions and conditions</title>
      <link>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1970158#M80042</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;I have a challenge and a long list of different kind of dimensions (age, sex, ...). Depending their values a score should be looked-up and added to a final score.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have looked at the existing matrix in Excel and created a database containing the 'conditions' for all dimensions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QV Excel Matrix.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/87115i9C0E35E24E9CAEA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="QV Excel Matrix.png" alt="QV Excel Matrix.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So the first is easy: if the subject is a male add 1 point to the score (if it is a female add 5).&lt;BR /&gt;Now the&amp;nbsp;&lt;STRONG&gt;'young male value'&lt;/STRONG&gt; (which is read from another database)&amp;nbsp;needs to be evaluated against the conditions in the series ref-val-ymv-1 to 9. So let it be 5,5 for now: it will not match against the condition&amp;nbsp;&lt;EM&gt;ref-val-ymv-0 [&amp;lt;3,5] &lt;STRONG&gt;(add 0) &lt;/STRONG&gt;but&amp;nbsp;&amp;nbsp;&lt;/EM&gt;the condition in&amp;nbsp;&lt;EM&gt;ref-val-ymv-4 &lt;/EM&gt;and therefore&amp;nbsp;&lt;STRONG&gt;add 4&lt;/STRONG&gt; to the total score&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;So...&lt;/EM&gt;&lt;BR /&gt;SUM(&lt;BR /&gt;If sex=male -&amp;gt; score = 1&amp;nbsp;&lt;BR /&gt;If sex=female -&amp;gt; score = 5&lt;BR /&gt;If youngmalevalue = 5,5 -&amp;gt; score = 4&lt;BR /&gt;... )&lt;BR /&gt;To get to the final score.&lt;/P&gt;
&lt;P&gt;The example above is an abbreviated list. The number of dimensions and their 'lookup'-conditions is rather limited but the original will contain about 70 rows and 20 columns therefore making it painstaking to evaluate all dimensions one by one creating formulas and even then adding it up to some final score.&lt;/P&gt;
&lt;P&gt;Hope someone can help me.&lt;/P&gt;
&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2022 09:35:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1970158#M80042</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2022-08-20T09:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a score based on a matrix with dimensions and conditions</title>
      <link>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1981235#M80970</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/63606"&gt;@MrBosch&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would personally look at the scripting options for this, you have the data. First thoughts from me, load left join the scores to your fact table. Then resident load, the key and scores for the fact table and drops the scores from the fact table. We now have your fact table and table. Next crosstab the scores table you three fields Key, Score type and score.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then front end you can just SUM(Score), or limit using set expressions {&amp;lt;[Score Type]={'Age'}&amp;gt;}&lt;/P&gt;
&lt;P&gt;Hope this makes sense and helps&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 06:18:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1981235#M80970</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2022-09-15T06:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a score based on a matrix with dimensions and conditions</title>
      <link>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1981635#M81004</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;An option it's to solve the problem using the script editor.&lt;BR /&gt;You can make a mapping table like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EdgarOlmos_0-1663257723253.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/89210iCE4F7C2ADFEBBE56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EdgarOlmos_0-1663257723253.png" alt="EdgarOlmos_0-1663257723253.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that, in the load of the transactional data with an applymap you can find the value that you need.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 16:03:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1981635#M81004</guid>
      <dc:creator>EdgarOlmos</dc:creator>
      <dc:date>2022-09-15T16:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a score based on a matrix with dimensions and conditions</title>
      <link>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1982207#M81056</link>
      <description>&lt;P&gt;Thank you so much. That will do the trick!&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 18:57:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculate-a-score-based-on-a-matrix-with-dimensions-and/m-p/1982207#M81056</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2022-09-17T18:57:32Z</dc:date>
    </item>
  </channel>
</rss>

