<?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 Need to Perform two Calculations in QVD load ... Loop? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-to-Perform-two-Calculations-in-QVD-load-Loop/m-p/297938#M710523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to arive at a summary data set for work performed in our facility.&amp;nbsp; Ulitmately what i would like to have is an Avg Manhours, Turn Around Time, Average Material Cost, and Average Material Cost per Day (=Avg Mat. Cost/Turn around Time).&amp;nbsp; I would like to do this without having to create multiple QVDs which then need to be loaded and calcuated upon in order to eventually arrive at this data set.&amp;nbsp; Is this possible? can it be done with a loop?&amp;nbsp; I have pasted my script below and it is not running because nested aggregation is not allowed.&amp;nbsp; That is because i am trying to Sum the Averages to arrive at a total material cost average per WO_DATA_CODE.&amp;nbsp;&amp;nbsp; &lt;EM style="font-size: 8pt;"&gt;(SUM(AVG(SUM_C_COST)+AVG(SUM_S_COST)+AVG(SUM_R_COST)) as MATERIAL_COST.&amp;nbsp; &lt;/EM&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any help in performing the calculation in bold and underlined in the script below would be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;WO_ORG_CODE&amp;amp;'_'&amp;amp;WO_GROUP_PRIMARY&amp;amp;'_'&amp;amp;WK_TYPE AS WO_DATA_CODE, &lt;/P&gt;&lt;P&gt;WO_GROUP_PRIMARY, WO_ORG_CODE, ROUND(AVG(HRS),.1) AS AVG_HRS,&lt;/P&gt;&lt;P&gt;AVG(HRS), &lt;/P&gt;&lt;P&gt;AVG(SUM_C_COST), &lt;/P&gt;&lt;P&gt;AVG(SUM_S_COST), &lt;/P&gt;&lt;P&gt;AVG(SUM_R_COST), &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;SUM(AVG(SUM_C_COST)+AVG(SUM_S_COST)+AVG(SUM_R_COST)) as MATERIAL_COST,&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;IF(ROUND(AVG([DAYS WORKED]),1)&amp;lt;1,1,ROUND(AVG([DAYS WORKED]),1)) AS TAT, &lt;/P&gt;&lt;P&gt;AVG([DAYS WORKED]) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM .\QVD\ARA_Completed_Work_Orders.qvd (qvd) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE &lt;/P&gt;&lt;P&gt;WO_POSITION_CODE ='SHOP' &lt;/P&gt;&lt;P&gt;and [LAST WK YEAR] &amp;gt; YEAR(ReloadTime())-4 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUP BY &lt;/P&gt;&lt;P&gt;WO_ORG_CODE&amp;amp;'_'&amp;amp;WO_GROUP_PRIMARY&amp;amp;'_'&amp;amp;WK_TYPE,&lt;/P&gt;&lt;P&gt;WO_GROUP_PRIMARY, WO_ORG_CODE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jul 2011 16:29:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-07-21T16:29:23Z</dc:date>
    <item>
      <title>Need to Perform two Calculations in QVD load ... Loop?</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Perform-two-Calculations-in-QVD-load-Loop/m-p/297938#M710523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to arive at a summary data set for work performed in our facility.&amp;nbsp; Ulitmately what i would like to have is an Avg Manhours, Turn Around Time, Average Material Cost, and Average Material Cost per Day (=Avg Mat. Cost/Turn around Time).&amp;nbsp; I would like to do this without having to create multiple QVDs which then need to be loaded and calcuated upon in order to eventually arrive at this data set.&amp;nbsp; Is this possible? can it be done with a loop?&amp;nbsp; I have pasted my script below and it is not running because nested aggregation is not allowed.&amp;nbsp; That is because i am trying to Sum the Averages to arrive at a total material cost average per WO_DATA_CODE.&amp;nbsp;&amp;nbsp; &lt;EM style="font-size: 8pt;"&gt;(SUM(AVG(SUM_C_COST)+AVG(SUM_S_COST)+AVG(SUM_R_COST)) as MATERIAL_COST.&amp;nbsp; &lt;/EM&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any help in performing the calculation in bold and underlined in the script below would be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;WO_ORG_CODE&amp;amp;'_'&amp;amp;WO_GROUP_PRIMARY&amp;amp;'_'&amp;amp;WK_TYPE AS WO_DATA_CODE, &lt;/P&gt;&lt;P&gt;WO_GROUP_PRIMARY, WO_ORG_CODE, ROUND(AVG(HRS),.1) AS AVG_HRS,&lt;/P&gt;&lt;P&gt;AVG(HRS), &lt;/P&gt;&lt;P&gt;AVG(SUM_C_COST), &lt;/P&gt;&lt;P&gt;AVG(SUM_S_COST), &lt;/P&gt;&lt;P&gt;AVG(SUM_R_COST), &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;SUM(AVG(SUM_C_COST)+AVG(SUM_S_COST)+AVG(SUM_R_COST)) as MATERIAL_COST,&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;IF(ROUND(AVG([DAYS WORKED]),1)&amp;lt;1,1,ROUND(AVG([DAYS WORKED]),1)) AS TAT, &lt;/P&gt;&lt;P&gt;AVG([DAYS WORKED]) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM .\QVD\ARA_Completed_Work_Orders.qvd (qvd) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE &lt;/P&gt;&lt;P&gt;WO_POSITION_CODE ='SHOP' &lt;/P&gt;&lt;P&gt;and [LAST WK YEAR] &amp;gt; YEAR(ReloadTime())-4 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUP BY &lt;/P&gt;&lt;P&gt;WO_ORG_CODE&amp;amp;'_'&amp;amp;WO_GROUP_PRIMARY&amp;amp;'_'&amp;amp;WK_TYPE,&lt;/P&gt;&lt;P&gt;WO_GROUP_PRIMARY, WO_ORG_CODE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 16:29:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Perform-two-Calculations-in-QVD-load-Loop/m-p/297938#M710523</guid>
      <dc:creator />
      <dc:date>2011-07-21T16:29:23Z</dc:date>
    </item>
  </channel>
</rss>

