<?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 Use MSSQL Function with table loaded from QVD in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Use-MSSQL-Function-with-table-loaded-from-QVD/m-p/1047999#M16443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table which stores all rentals and sales inventory. But because this table will be used across different reports, I have exported the who table to a QVD.&lt;/P&gt;&lt;P&gt;Now for one of the report I am working on, I only need the Sales Inventory Data which can be mapped by the Inventory Catalog to extract items. But I need to apply an MSSQL function to extract the purchase value on a particular day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what i am trying to do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dailyinventorystatus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;RWReports.dbo.FindPurchasePrice(Inventorykey, TransDate , warehouse) as PurchasePrice;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;warehouse,&lt;/P&gt;&lt;P&gt;Date(Date, 'YYYY-MM-DD') as TransDate,&lt;/P&gt;&lt;P&gt;Inventorykey,&lt;/P&gt;&lt;P&gt;warehousekey,&lt;/P&gt;&lt;P&gt;OwnedQty,&lt;/P&gt;&lt;P&gt;FROM 'lib://QlikQVDs/dailyinventorystatus.qvd' (qvd)&lt;/P&gt;&lt;P&gt;WHERE exists (masterid, Inventorykey)&lt;/P&gt;&lt;P&gt;and exists (warehouseid, warehousekey);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this clearly does not work.Can something like this be achieved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally have I used the Where exists correctly? For example I have the Inventory Table which has the masterid which can be mapped to the Inventorykey. With in the inventory table I am only extracting Sales Inventory, so in this case would the where exists work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, how would I use the Function FindPurchaseprice from the Loaded Invetorykey, Warehouse, and Date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Feb 2016 21:54:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-02-16T21:54:16Z</dc:date>
    <item>
      <title>Use MSSQL Function with table loaded from QVD</title>
      <link>https://community.qlik.com/t5/App-Development/Use-MSSQL-Function-with-table-loaded-from-QVD/m-p/1047999#M16443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table which stores all rentals and sales inventory. But because this table will be used across different reports, I have exported the who table to a QVD.&lt;/P&gt;&lt;P&gt;Now for one of the report I am working on, I only need the Sales Inventory Data which can be mapped by the Inventory Catalog to extract items. But I need to apply an MSSQL function to extract the purchase value on a particular day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what i am trying to do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dailyinventorystatus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;RWReports.dbo.FindPurchasePrice(Inventorykey, TransDate , warehouse) as PurchasePrice;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;warehouse,&lt;/P&gt;&lt;P&gt;Date(Date, 'YYYY-MM-DD') as TransDate,&lt;/P&gt;&lt;P&gt;Inventorykey,&lt;/P&gt;&lt;P&gt;warehousekey,&lt;/P&gt;&lt;P&gt;OwnedQty,&lt;/P&gt;&lt;P&gt;FROM 'lib://QlikQVDs/dailyinventorystatus.qvd' (qvd)&lt;/P&gt;&lt;P&gt;WHERE exists (masterid, Inventorykey)&lt;/P&gt;&lt;P&gt;and exists (warehouseid, warehousekey);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this clearly does not work.Can something like this be achieved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally have I used the Where exists correctly? For example I have the Inventory Table which has the masterid which can be mapped to the Inventorykey. With in the inventory table I am only extracting Sales Inventory, so in this case would the where exists work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, how would I use the Function FindPurchaseprice from the Loaded Invetorykey, Warehouse, and Date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 21:54:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-MSSQL-Function-with-table-loaded-from-QVD/m-p/1047999#M16443</guid>
      <dc:creator />
      <dc:date>2016-02-16T21:54:16Z</dc:date>
    </item>
  </channel>
</rss>

