<?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 Re: Graph displays a blank category with Sales cost in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Graph-displays-a-blank-category-with-Sales-cost/m-p/1040446#M16163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is simply getting only Inventory Items that belongs to Category. Every Inventory Item belong to a category. You cannot have Inventory which does not belong to a Category. Also even with that condition removed, I see Sales for Categories that do not exist. I am thinking there must be something wrong with the concatenation statement for SalesAndPurchases. But I cannot seem to figure out what the problem is exactly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also for the current year 2016. The graph is only displaying categories that have Sales OR Purchases. However, I want it to display all categories regardless of whether it has Sales or Purchases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jan 2016 18:41:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-01-20T18:41:21Z</dc:date>
    <item>
      <title>Graph displays a blank category with Sales cost</title>
      <link>https://community.qlik.com/t5/App-Development/Graph-displays-a-blank-category-with-Sales-cost/m-p/1040444#M16161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to create a report which pulls data from MSSQL database. &lt;/P&gt;&lt;P&gt;There are currently two issues I am experiencing with this report:&lt;/P&gt;&lt;P&gt;1. It does not show Inventory items with no sales and no cost. &lt;/P&gt;&lt;P&gt;2. There is a blank category that appears with a sales value. However it is disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what my current data model looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inventory:&lt;/P&gt;&lt;P&gt;Load *;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;RTRIM(m.masterid) masterid, &lt;/P&gt;&lt;P&gt;masterno,&lt;/P&gt;&lt;P&gt;master as ICodeDescription, &lt;/P&gt;&lt;P&gt;availfrom,&lt;/P&gt;&lt;P&gt;availfor,&lt;/P&gt;&lt;P&gt;categoryid&lt;/P&gt;&lt;P&gt;FROM rentalworks.dbo.master m&lt;/P&gt;&lt;P&gt;WHERE availfor='S'&lt;/P&gt;&lt;P&gt;and availfrom = 'W'&lt;/P&gt;&lt;P&gt;and inactive&amp;lt;&amp;gt;'T';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Category:&lt;/P&gt;&lt;P&gt;Load *;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;category,&lt;/P&gt;&lt;P&gt;categoryid&lt;/P&gt;&lt;P&gt;FROM Rentalworks.dbo.category c &lt;/P&gt;&lt;P&gt;WHERE inactive&amp;lt;&amp;gt;'T';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (Category)&lt;/P&gt;&lt;P&gt;Load categoryid&lt;/P&gt;&lt;P&gt;Resident Inventory;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warehouse:&lt;/P&gt;&lt;P&gt;Load *;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;warehouse,&lt;/P&gt;&lt;P&gt;warehouseid&lt;/P&gt;&lt;P&gt;FROM rentalworks.dbo.warehouse&lt;/P&gt;&lt;P&gt;where inactive&amp;lt;&amp;gt;'T';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* ----------------- Load, Select and Join Sales and Purchases ----------*/&lt;/P&gt;&lt;P&gt;SalesAndPurchases: &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;warehouse,&lt;/P&gt;&lt;P&gt;masterid,&lt;/P&gt;&lt;P&gt;//masterno,&lt;/P&gt;&lt;P&gt;//ICodeDescription,&lt;/P&gt;&lt;P&gt;Date(TransactionDate, 'YYYY-MM-DD') as TransactionDate,&lt;/P&gt;&lt;P&gt;TransactionType,&lt;/P&gt;&lt;P&gt;orderno,&lt;/P&gt;&lt;P&gt;UnitPurchasePrice,&lt;/P&gt;&lt;P&gt;PurchaseQty,&lt;/P&gt;&lt;P&gt;ExtendedCostPrice;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;sc.warehouse,&lt;/P&gt;&lt;P&gt;RTRIM(sc.InventoryKey) as masterid,&lt;/P&gt;&lt;P&gt;//RTRIM(sc.ICode) as masterno,&lt;/P&gt;&lt;P&gt;//RTRIM(ICodeDescription) as ICodeDescription,&lt;/P&gt;&lt;P&gt;sc.TransactionDate,&lt;/P&gt;&lt;P&gt;sc.TransactionType,&lt;/P&gt;&lt;P&gt;REVERSE(SUBSTRING(REVERSE(RTRIM(sc.ChangeDescription)), 1, &lt;/P&gt;&lt;P&gt;&amp;nbsp; CHARINDEX(' ', REVERSE(RTRIM(sc.ChangeDescription))) - 1)) as orderno,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;case when (sc.TransactionType='PURCHASE') then UnitPriceAddition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; when (sc.TransactionType ='VENDOR RETURN') then UnitPriceSubtraction&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end as UnitPurchasePrice,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;case when (sc.TransactionType='PURCHASE') then AdditionQty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; when (sc.TransactionType='VENDOR RETURN') then SubtractionQty&lt;/P&gt;&lt;P&gt;&amp;nbsp; end as PurchaseQty,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt; case when (sc.TransactionType='PURCHASE') then ExtendedAdditionPrice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; when (sc.TransactionType='VENDOR RETURN') then ExtendedSubtractionPrice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end as ExtendedCostPrice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM PSRentalworksDW.dbo.SalesInventoryChange sc&lt;/P&gt;&lt;P&gt;WHERE (sc.TransactionType ='PURCHASE' OR sc.TransactionType='VENDOR RETURN')&lt;/P&gt;&lt;P&gt;AND sc.TransactionDate &amp;gt;= '2013-01-01';&lt;/P&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;&lt;P&gt;Concatenate (SalesAndPurchases)&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;warehouse,&lt;/P&gt;&lt;P&gt;masterid,&lt;/P&gt;&lt;P&gt;//masterno,&lt;/P&gt;&lt;P&gt;//ICodeDescription,&lt;/P&gt;&lt;P&gt;Date(TransactionDate, 'YYYY-MM-DD') as TransactionDate,&lt;/P&gt;&lt;P&gt;TransactionType,&lt;/P&gt;&lt;P&gt;orderno,&lt;/P&gt;&lt;P&gt;UnitSalePrice,&lt;/P&gt;&lt;P&gt;SalesQty,&lt;/P&gt;&lt;P&gt;ExtendedSalesPrice;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT &lt;/P&gt;&lt;P&gt;es.warehouse,&lt;/P&gt;&lt;P&gt;RTRIM(es.masterid) masterid,&lt;/P&gt;&lt;P&gt;//es.masterno,&lt;/P&gt;&lt;P&gt;//es.description as ICodeDescription, &lt;/P&gt;&lt;P&gt;es.transdate as TransactionDate,&lt;/P&gt;&lt;P&gt;es.transtype as TransactionType,&lt;/P&gt;&lt;P&gt;es.orderno,&lt;/P&gt;&lt;P&gt;es.price as UnitSalePrice,&lt;/P&gt;&lt;P&gt;es.qtyordered as SalesQty,&lt;/P&gt;&lt;P&gt;es.priceextended as ExtendedSalesPrice&lt;/P&gt;&lt;P&gt;FROM RWReports.dbo.ExpendableSales es;&lt;/P&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;&lt;P&gt;INNER JOIN (SalesAndPurchases)&lt;/P&gt;&lt;P&gt;Load warehouse &lt;/P&gt;&lt;P&gt;Resident Warehouse;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LEFT JOIN (SalesAndPurchases)&lt;/P&gt;&lt;P&gt;Load masterid &lt;/P&gt;&lt;P&gt;Resident Inventory;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure why either of that is happening as all items belong to a category. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 18:14:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Graph-displays-a-blank-category-with-Sales-cost/m-p/1040444#M16161</guid>
      <dc:creator />
      <dc:date>2016-01-20T18:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Graph displays a blank category with Sales cost</title>
      <link>https://community.qlik.com/t5/App-Development/Graph-displays-a-blank-category-with-Sales-cost/m-p/1040445#M16162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Asma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;generally speaking, both problems are happening because of your INNER JOINs and LEFT JOINs... By using INNER and LEFT, you are limiting your field values to only those that have either Inventory, or Sales, or Both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;INNER JOIN (Category)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load categoryid&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident Inventory;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;this statement limits Categories only to those that have Inventory. This is the reason for your problem #2 - you have Sales for certain Categories that don't exist. They don't exist (most likely) because they don't have Inventory and therefore got excluded.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In a similar way, your inventory items that don't have sales must be excluded by an INNER or a LEFT JOIN (I didn't scan your code to find the specific load, but it is very likely the case.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Upgrade your Qlik skills at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Milan, Italy!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 18:35:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Graph-displays-a-blank-category-with-Sales-cost/m-p/1040445#M16162</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2016-01-20T18:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Graph displays a blank category with Sales cost</title>
      <link>https://community.qlik.com/t5/App-Development/Graph-displays-a-blank-category-with-Sales-cost/m-p/1040446#M16163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is simply getting only Inventory Items that belongs to Category. Every Inventory Item belong to a category. You cannot have Inventory which does not belong to a Category. Also even with that condition removed, I see Sales for Categories that do not exist. I am thinking there must be something wrong with the concatenation statement for SalesAndPurchases. But I cannot seem to figure out what the problem is exactly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also for the current year 2016. The graph is only displaying categories that have Sales OR Purchases. However, I want it to display all categories regardless of whether it has Sales or Purchases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 18:41:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Graph-displays-a-blank-category-with-Sales-cost/m-p/1040446#M16163</guid>
      <dc:creator />
      <dc:date>2016-01-20T18:41:21Z</dc:date>
    </item>
  </channel>
</rss>

