<?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 Weird Join Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Weird-Join-Question/m-p/1215806#M389421</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;this is a 3 section question and i think fixing any of the 3 section will fix my issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so below i have this table&lt;/P&gt;&lt;P&gt;&lt;IMG alt="qe.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/156437_qe.JPG" style="height: 183px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically its color and item code then a hashcode then image location&amp;nbsp; &lt;/P&gt;&lt;P&gt;the issue is i have multiple location and i need to try to narrow it down to one..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are 3 ways -- 2 of them in qv and not sure how to do it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 the formula used to pull the location should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=firstsortedvalue(swlocation,&lt;/P&gt;&lt;P&gt;- aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {$&amp;lt;DTL.Flag_OrderStatus={1}&amp;gt;}DTL.Qty*DTL.Flag_OrderStatus)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,PD.Style,swlocation)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which should work because of the first sorted.. but it doesnt seem to work not sure why..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the other way is the join where we got this table..&amp;nbsp; i am joining 2 tables to get this one..&lt;/P&gt;&lt;P&gt;if somehow i can do max or something&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct i.itemCode, color =col.dimensionLong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bcItemCode =reverse(substring(reverse(i.itemcode),1,4)),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemDesc = i.itemDesc,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BCColorCode =isnull(bc_col.color_code,''),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Swatch =isnull(img.ImageUrl,'')&lt;/P&gt;&lt;P&gt;from dbo.VItem i&lt;/P&gt;&lt;P&gt;join .VItemVariant iv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on i.itemId = iv.itemId&lt;/P&gt;&lt;P&gt;join VDimension col&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on col.dimensionId =iv.colorId&lt;/P&gt;&lt;P&gt;left join.dbo.zzxcolrr bc_col&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on bc_col.color_group + bc_col.nrf_color =col.dimensionCode+col.nrf collate Chinese_PRC_CI_AS&lt;/P&gt;&lt;P&gt;left join .VImage img&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on img.classId =iv.itemVariantId&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and img.ObjectType ='ItemVariant'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and img.imageType ='Standard Image'&lt;/P&gt;&lt;P&gt;where i.Category ='Fabric'&lt;/P&gt;&lt;P&gt;or i.Category = 'Yarn'&lt;/P&gt;&lt;P&gt;and i.SeasonId &amp;gt; 429542&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;join(FabImages)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;bcItemCode as BCItemCode,&lt;/P&gt;&lt;P&gt;BCColorCode as BCColorcode,&lt;/P&gt;&lt;P&gt;Swatch as swlocation,&lt;/P&gt;&lt;P&gt;hash128(bcItemCode,BCColorCode) as fabcolor&lt;/P&gt;&lt;P&gt;resident temp14;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure whats the easiest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Mar 2017 22:38:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-15T22:38:32Z</dc:date>
    <item>
      <title>Weird Join Question</title>
      <link>https://community.qlik.com/t5/QlikView/Weird-Join-Question/m-p/1215806#M389421</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;this is a 3 section question and i think fixing any of the 3 section will fix my issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so below i have this table&lt;/P&gt;&lt;P&gt;&lt;IMG alt="qe.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/156437_qe.JPG" style="height: 183px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically its color and item code then a hashcode then image location&amp;nbsp; &lt;/P&gt;&lt;P&gt;the issue is i have multiple location and i need to try to narrow it down to one..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are 3 ways -- 2 of them in qv and not sure how to do it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 the formula used to pull the location should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=firstsortedvalue(swlocation,&lt;/P&gt;&lt;P&gt;- aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {$&amp;lt;DTL.Flag_OrderStatus={1}&amp;gt;}DTL.Qty*DTL.Flag_OrderStatus)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,PD.Style,swlocation)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which should work because of the first sorted.. but it doesnt seem to work not sure why..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the other way is the join where we got this table..&amp;nbsp; i am joining 2 tables to get this one..&lt;/P&gt;&lt;P&gt;if somehow i can do max or something&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct i.itemCode, color =col.dimensionLong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bcItemCode =reverse(substring(reverse(i.itemcode),1,4)),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemDesc = i.itemDesc,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BCColorCode =isnull(bc_col.color_code,''),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Swatch =isnull(img.ImageUrl,'')&lt;/P&gt;&lt;P&gt;from dbo.VItem i&lt;/P&gt;&lt;P&gt;join .VItemVariant iv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on i.itemId = iv.itemId&lt;/P&gt;&lt;P&gt;join VDimension col&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on col.dimensionId =iv.colorId&lt;/P&gt;&lt;P&gt;left join.dbo.zzxcolrr bc_col&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on bc_col.color_group + bc_col.nrf_color =col.dimensionCode+col.nrf collate Chinese_PRC_CI_AS&lt;/P&gt;&lt;P&gt;left join .VImage img&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on img.classId =iv.itemVariantId&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and img.ObjectType ='ItemVariant'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and img.imageType ='Standard Image'&lt;/P&gt;&lt;P&gt;where i.Category ='Fabric'&lt;/P&gt;&lt;P&gt;or i.Category = 'Yarn'&lt;/P&gt;&lt;P&gt;and i.SeasonId &amp;gt; 429542&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;join(FabImages)&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;bcItemCode as BCItemCode,&lt;/P&gt;&lt;P&gt;BCColorCode as BCColorcode,&lt;/P&gt;&lt;P&gt;Swatch as swlocation,&lt;/P&gt;&lt;P&gt;hash128(bcItemCode,BCColorCode) as fabcolor&lt;/P&gt;&lt;P&gt;resident temp14;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure whats the easiest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 22:38:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Weird-Join-Question/m-p/1215806#M389421</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-15T22:38:32Z</dc:date>
    </item>
  </channel>
</rss>

