<?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 Multiply (or divide) two values from the same dimension in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380265#M701814</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to create calculated value based on other values from the same dimension. As an example, I have an account Sales and an account COGS. Now I want to create a new account "COGS in % of Sales". This would be easy in a table but I need to create this in the load script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LoadData:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Period, Account, Value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201201, Sales, 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201201, COGS, 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201202, Sales, 110&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201202, COGS, 45&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would need something like&lt;/P&gt;&lt;P&gt;concatenate &lt;/P&gt;&lt;P&gt;load Period,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "COGS in % of Sales" as Account,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (load Value resident LoadData where Account = 'COGS') / (load Value resident LoadData where Account = 'Sales') as Value&lt;/P&gt;&lt;P&gt;Resident LoadData;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2012 09:41:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-23T09:41:27Z</dc:date>
    <item>
      <title>Multiply (or divide) two values from the same dimension in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380265#M701814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to create calculated value based on other values from the same dimension. As an example, I have an account Sales and an account COGS. Now I want to create a new account "COGS in % of Sales". This would be easy in a table but I need to create this in the load script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LoadData:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Period, Account, Value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201201, Sales, 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201201, COGS, 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201202, Sales, 110&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201202, COGS, 45&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would need something like&lt;/P&gt;&lt;P&gt;concatenate &lt;/P&gt;&lt;P&gt;load Period,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "COGS in % of Sales" as Account,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (load Value resident LoadData where Account = 'COGS') / (load Value resident LoadData where Account = 'Sales') as Value&lt;/P&gt;&lt;P&gt;Resident LoadData;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 09:41:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380265#M701814</guid>
      <dc:creator />
      <dc:date>2012-08-23T09:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply (or divide) two values from the same dimension in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380266#M701815</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;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;concatenate&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;load Period,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "COGS in % of Sales" as Account,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(If(Account = 'COGS', Value)) / Sum(If(Account = 'Sales', Value)) as Value&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Resident LoadData&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Group By Period;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 09:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380266#M701815</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-23T09:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply (or divide) two values from the same dimension in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380267#M701816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The 'COGS in % of Sales' must be in single quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 10:25:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380267#M701816</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-23T10:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply (or divide) two values from the same dimension in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380268#M701817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/blush.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 13:57:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Multiply-or-divide-two-values-from-the-same-dimension-in-load/m-p/380268#M701817</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-23T13:57:01Z</dc:date>
    </item>
  </channel>
</rss>

