<?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 Unit Conversation in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Unit-Conversation-in-Script/m-p/1665711#M594761</link>
    <description>&lt;P&gt;I have the following the following two tables . one is Unit Conversion and second one is product.&lt;/P&gt;&lt;P&gt;Unit_Conv:&lt;/P&gt;&lt;P&gt;Unit_Conv:&lt;BR /&gt;Load * INLINE[&lt;BR /&gt;PriceUnt, QuantityUnt, ConversationRate&lt;BR /&gt;$/liter, gal, 3.78&lt;BR /&gt;$/gal, liter, 0.264&lt;BR /&gt;$/gal, ml, 0.0002&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product:&lt;/P&gt;&lt;P&gt;Load * INLINE [&lt;BR /&gt;Product, ProductID, Price, PriceUnit, Quantity, QuantityUnit&lt;BR /&gt;Diesel, 1, 5, $/liter, 20, gal&lt;BR /&gt;Petrol, 2, 8, $/gal, 30, liter&lt;BR /&gt;CNG, 3, 6, $/gal, 40, ml&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;To get the total cost of a product the unit needs to&amp;nbsp; be converted according to the unit of Quantity then it should be multiplied by QuantityUnit.&lt;/P&gt;&lt;P&gt;For example, to get the total cost of Diesel the PriceUnit needs to be converted from $/liter to $/gal as QuantityUnit is gal. So the total cost of Diesel will be =&amp;nbsp; 5 * 3.78(Unit Conversion rate) * 20 = 378 $.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to achieve this in Qlik Script? Suggestion please. Test file is attached.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:30:31 GMT</pubDate>
    <dc:creator>safik003</dc:creator>
    <dc:date>2024-11-16T01:30:31Z</dc:date>
    <item>
      <title>Unit Conversation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Unit-Conversation-in-Script/m-p/1665711#M594761</link>
      <description>&lt;P&gt;I have the following the following two tables . one is Unit Conversion and second one is product.&lt;/P&gt;&lt;P&gt;Unit_Conv:&lt;/P&gt;&lt;P&gt;Unit_Conv:&lt;BR /&gt;Load * INLINE[&lt;BR /&gt;PriceUnt, QuantityUnt, ConversationRate&lt;BR /&gt;$/liter, gal, 3.78&lt;BR /&gt;$/gal, liter, 0.264&lt;BR /&gt;$/gal, ml, 0.0002&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product:&lt;/P&gt;&lt;P&gt;Load * INLINE [&lt;BR /&gt;Product, ProductID, Price, PriceUnit, Quantity, QuantityUnit&lt;BR /&gt;Diesel, 1, 5, $/liter, 20, gal&lt;BR /&gt;Petrol, 2, 8, $/gal, 30, liter&lt;BR /&gt;CNG, 3, 6, $/gal, 40, ml&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;To get the total cost of a product the unit needs to&amp;nbsp; be converted according to the unit of Quantity then it should be multiplied by QuantityUnit.&lt;/P&gt;&lt;P&gt;For example, to get the total cost of Diesel the PriceUnit needs to be converted from $/liter to $/gal as QuantityUnit is gal. So the total cost of Diesel will be =&amp;nbsp; 5 * 3.78(Unit Conversion rate) * 20 = 378 $.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to achieve this in Qlik Script? Suggestion please. Test file is attached.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:30:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unit-Conversation-in-Script/m-p/1665711#M594761</guid>
      <dc:creator>safik003</dc:creator>
      <dc:date>2024-11-16T01:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Unit Conversation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Unit-Conversation-in-Script/m-p/1665713#M594765</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;Your valuable input please.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 09:45:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unit-Conversation-in-Script/m-p/1665713#M594765</guid>
      <dc:creator>safik003</dc:creator>
      <dc:date>2020-01-15T09:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Unit Conversation in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Unit-Conversation-in-Script/m-p/1665758#M594769</link>
      <description>&lt;P&gt;Maybe with an approach like this one:&lt;/P&gt;&lt;P&gt;Unit_Conv:&lt;BR /&gt;&lt;STRONG&gt;mapping load PriceUnt &amp;amp; '|' &amp;amp; QuantityUnt, ConversationRate;&lt;/STRONG&gt;&lt;BR /&gt;Load * INLINE[&lt;BR /&gt;PriceUnt, QuantityUnt, ConversationRate&lt;BR /&gt;$/liter, gal, 3.78&lt;BR /&gt;$/gal, liter, 0.264&lt;BR /&gt;$/gal, ml, 0.0002&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Product:&lt;BR /&gt;&lt;STRONG&gt;load *, applymap('Unit_Conv', PriceUnit &amp;amp; '|' &amp;amp; QuantityUnit, 0) * Price as TotalCosts;&lt;/STRONG&gt;&lt;BR /&gt;Load * INLINE [&lt;BR /&gt;Product, ProductID, Price, PriceUnit, Quantity, QuantityUnit&lt;BR /&gt;Diesel, 1, 5, $/liter, 20, gal&lt;BR /&gt;Petrol, 2, 8, $/gal, 30, liter&lt;BR /&gt;CNG, 3, 6, $/gal, 40, ml&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 12:19:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Unit-Conversation-in-Script/m-p/1665758#M594769</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-01-15T12:19:51Z</dc:date>
    </item>
  </channel>
</rss>

