<?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 Simple calculation in load script not creating any values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Simple-calculation-in-load-script-not-creating-any-values/m-p/1508302#M750718</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm loading a table to pre-summarise then just trying to find the difference between the two so I can pull data from a text bank. I've put together the below loading script which doesn't error however if I use [Avg Score Are] or [Avg Score Want] in my dashboard I get results as expected, but &lt;FONT color="#ff0000"&gt;[Avg Diff]&lt;/FONT&gt; doesn't display any results at all.&lt;/P&gt;&lt;P&gt;I think I'm missing something obvious but been stuck on this one for a while!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[PreSummarise]:
LOAD
[Company Name],
[QI],
[Where we],
Avg([Question Score]) AS [Avg Score Are],
Sum([Question Score]) AS [Total Score Are]
Resident EVP.Diagnostic.Survey.TestData1
where [Where we] = 'Are'
and [Company Name] = '$(vCompanyName)'
group by
[Company Name],
[QI],
[Where we];

JOIN
LOAD
[Company Name],
[QI],
[Where we],
Avg([Question Score]) AS [Avg Score Want],
Sum([Question Score]) AS [Total Score Want]
//Sum([Question Score]) - [Total Score Are] AS [Total Dif]
Resident EVP.Diagnostic.Survey.TestData1
where [Where we] = 'Want'
and [Company Name] = '$(vCompanyName)'
group by
[Company Name],
[QI],
[Where we];


[Summarise]:
LOAD	
[Company Name],
[QI],
[Where we],
&lt;FONT color="#ff0000"&gt;[Avg Score Want]-[Avg Score Are] as [Avg Diff] //I don't know why this doesn't work&lt;/FONT&gt;
Resident PreSummarise&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>thomasmercer</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Simple calculation in load script not creating any values</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-calculation-in-load-script-not-creating-any-values/m-p/1508302#M750718</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm loading a table to pre-summarise then just trying to find the difference between the two so I can pull data from a text bank. I've put together the below loading script which doesn't error however if I use [Avg Score Are] or [Avg Score Want] in my dashboard I get results as expected, but &lt;FONT color="#ff0000"&gt;[Avg Diff]&lt;/FONT&gt; doesn't display any results at all.&lt;/P&gt;&lt;P&gt;I think I'm missing something obvious but been stuck on this one for a while!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[PreSummarise]:
LOAD
[Company Name],
[QI],
[Where we],
Avg([Question Score]) AS [Avg Score Are],
Sum([Question Score]) AS [Total Score Are]
Resident EVP.Diagnostic.Survey.TestData1
where [Where we] = 'Are'
and [Company Name] = '$(vCompanyName)'
group by
[Company Name],
[QI],
[Where we];

JOIN
LOAD
[Company Name],
[QI],
[Where we],
Avg([Question Score]) AS [Avg Score Want],
Sum([Question Score]) AS [Total Score Want]
//Sum([Question Score]) - [Total Score Are] AS [Total Dif]
Resident EVP.Diagnostic.Survey.TestData1
where [Where we] = 'Want'
and [Company Name] = '$(vCompanyName)'
group by
[Company Name],
[QI],
[Where we];


[Summarise]:
LOAD	
[Company Name],
[QI],
[Where we],
&lt;FONT color="#ff0000"&gt;[Avg Score Want]-[Avg Score Are] as [Avg Diff] //I don't know why this doesn't work&lt;/FONT&gt;
Resident PreSummarise&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-calculation-in-load-script-not-creating-any-values/m-p/1508302#M750718</guid>
      <dc:creator>thomasmercer</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Simple calculation in load script not creating any values</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-calculation-in-load-script-not-creating-any-values/m-p/1508303#M750719</link>
      <description>&lt;P&gt;When you join the two tables, remove the join on Where We field because they have different values... the two Averages won't align against each other&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[PreSummarise]:
LOAD
[Company Name],
[QI],
&lt;FONT color="#FF0000"&gt;&lt;STRIKE&gt;[Where we],&lt;/STRIKE&gt;&lt;/FONT&gt;
Avg([Question Score]) AS [Avg Score Are],
Sum([Question Score]) AS [Total Score Are]
Resident EVP.Diagnostic.Survey.TestData1
where [Where we] = 'Are'
and [Company Name] = '$(vCompanyName)'
group by
[Company Name],
[QI],
&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;[Where we]&lt;/FONT&gt;&lt;/STRIKE&gt;;

JOIN
LOAD
[Company Name],
[QI],
&lt;FONT color="#FF0000"&gt;&lt;STRIKE&gt;[Where we]&lt;/STRIKE&gt;&lt;/FONT&gt;,
Avg([Question Score]) AS [Avg Score Want],
Sum([Question Score]) AS [Total Score Want]
//Sum([Question Score]) - [Total Score Are] AS [Total Dif]
Resident EVP.Diagnostic.Survey.TestData1
where [Where we] = 'Want'
and [Company Name] = '$(vCompanyName)'
group by
[Company Name],
[QI],
&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;[Where we]&lt;/FONT&gt;&lt;/STRIKE&gt;;


[Summarise]:
LOAD	
[Company Name],
[QI],
&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;[Where we],&lt;/FONT&gt;&lt;/STRIKE&gt;
[Avg Score Want]-[Avg Score Are] as [Avg Diff] //I don't know why this doesn't work
Resident PreSummarise;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 17:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-calculation-in-load-script-not-creating-any-values/m-p/1508303#M750719</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-11-16T17:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Simple calculation in load script not creating any values</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-calculation-in-load-script-not-creating-any-values/m-p/1508308#M750720</link>
      <description>Excellent! Works a treat. Thanks Stalwar1</description>
      <pubDate>Fri, 16 Nov 2018 17:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-calculation-in-load-script-not-creating-any-values/m-p/1508308#M750720</guid>
      <dc:creator>thomasmercer</dc:creator>
      <dc:date>2018-11-16T17:29:47Z</dc:date>
    </item>
  </channel>
</rss>

