<?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 Creating a score in the Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878911#M655505</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to Qlikview and I'm trying to create a score for both the unit and an average score for the buyer based on the value of a number of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(UNIT.M_M / 1000) + UNIT.AGE + (UNIT.FIX*10) +&amp;nbsp; (UNIT.CC /1000) as Unit.GCT_Score,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(avg(UNIT.M_M / 1000) + Avg(UNIT.AGE) + Avg(UNIT.FIX*10) +&amp;nbsp; Avg(UNIT.CC /1000)) as Buyer.GCT_Score,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first one (unit score) works brilliantly but when I load the script with the buyer score expression I get an error and it says I have an invalid expression in my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas? Any help would be very much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2015 10:20:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-07-15T10:20:57Z</dc:date>
    <item>
      <title>Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878911#M655505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to Qlikview and I'm trying to create a score for both the unit and an average score for the buyer based on the value of a number of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(UNIT.M_M / 1000) + UNIT.AGE + (UNIT.FIX*10) +&amp;nbsp; (UNIT.CC /1000) as Unit.GCT_Score,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num(avg(UNIT.M_M / 1000) + Avg(UNIT.AGE) + Avg(UNIT.FIX*10) +&amp;nbsp; Avg(UNIT.CC /1000)) as Buyer.GCT_Score,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first one (unit score) works brilliantly but when I load the script with the buyer score expression I get an error and it says I have an invalid expression in my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas? Any help would be very much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 10:20:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878911#M655505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-15T10:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878912#M655506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gareth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're using Avg() you're aggregating the data - are you using a Group By statement when loading? If not, you'll need to include the fields you want to group by for your aggregation in that statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 10:26:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878912#M655506</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2015-07-15T10:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878913#M655507</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;Whenever you use aggregation function in your load statement, you must use group by statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load ID,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;num(avg(UNIT.M_M / 1000) + Avg(UNIT.AGE) + Avg(UNIT.FIX*10) +&amp;nbsp; Avg(UNIT.CC /1000)) as Buyer.GCT_Score&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;from datasource&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;group by ID;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 10:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878913#M655507</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2015-07-15T10:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878914#M655508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like I said I am new, where would you add the Group by statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 10:31:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878914#M655508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-15T10:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878915#M655509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing group by clause. avg function is the aggregation function, so you need to include remaining &lt;SPAN style="font-size: 13.3333330154419px;"&gt;fields in &lt;/SPAN&gt;group by&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 10:32:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878915#M655509</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-07-15T10:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878916#M655510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Underneath your source, so after loading you'd put:&lt;/P&gt;&lt;P&gt;From xxxxx.xxx&lt;/P&gt;&lt;P&gt;Group by Buyer;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you just want an average for every buyer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 10:33:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878916#M655510</guid>
      <dc:creator>morganaaron</dc:creator>
      <dc:date>2015-07-15T10:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878917#M655511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you everyone you have all been very helpful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 11:18:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878917#M655511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-15T11:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878918#M655512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Aaron!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 11:19:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878918#M655512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-15T11:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878919#M655513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok so like I said that worked brilliantly but now I want to add an if to the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my script,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;load&lt;/TD&gt;&lt;TD&gt;%_BNO,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(UNIT.GRADEFIX = '' , '', num(avg(UNIT.M_MILEAGE / 1000) + Avg(UNIT.AGEMONTHS) + Avg(UNIT.GRADEFIX*10) +&amp;nbsp; Avg(UNIT.CAPCLEAN_ORIG /1000))) as Buyer.GCT_Score&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[$(QVD_Path)\BUYER_unit.qvd]&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;group by %_BNO;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's again saying invalid expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 12:28:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878919#M655513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-15T12:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a score in the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878920#M655514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG style="font-size: 11.6999998092651px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/GarethCT"&gt;GarethCT&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As your issue is resolved, please select&lt;STRONG style="font-size: 11.6999998092651px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; Correct Answer.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 13:43:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-score-in-the-Script/m-p/878920#M655514</guid>
      <dc:creator>qlikviewwizard</dc:creator>
      <dc:date>2015-07-15T13:43:08Z</dc:date>
    </item>
  </channel>
</rss>

