<?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: Syntax errors when joining tables in Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1647116#M594013</link>
    <description>&lt;P&gt;This works for counting the shortages perfectly.&amp;nbsp; Now I need to be able to classify by the shortage count&amp;nbsp; and then name the shorted component:&lt;/P&gt;&lt;P&gt;if(InventoryShortage=0, "WorkOrder", if "inventoryShortage=1,"ComponentIssue"....&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;P&gt;If (InventoryShortage=1 and QOH&amp;lt;ComponenentTotal, ItemShortNumber, blank)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should this be done with a resident table?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2019 16:13:33 GMT</pubDate>
    <dc:creator>nburton78</dc:creator>
    <dc:date>2019-11-14T16:13:33Z</dc:date>
    <item>
      <title>Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646636#M594006</link>
      <description>&lt;P&gt;I'm having problems finishing this script and its making me crazy.&amp;nbsp; I know its my syntax but I can't figure it out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create 3 fields in my script.&amp;nbsp; Below is the explanation of each field and how it's written in Excel.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;InventoryShortage:&amp;nbsp;Count the number of Components that were short per Parent&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excel Example:&amp;nbsp;'=COUNTIFS(A:A,A2,F:F,"InventoryShort")&lt;/P&gt;&lt;P&gt;IssueType:&amp;nbsp;Determine the type of issue based on the number of short components&lt;/P&gt;&lt;P&gt;Excel Example:&amp;nbsp;'=IF(H2=0,"Workorderissue",IF(H2=1,"ComponentIssue",IF(H2&amp;gt;1,"MultipleComponents",0)))&lt;/P&gt;&lt;P&gt;LowerLevel:&amp;nbsp;Return the Short component when the issue type is =1 and InventoryStatus is "InventoryShort"&lt;/P&gt;&lt;P&gt;Excel Example:&amp;nbsp;'=IF(AND(F2="InventoryShort",G2=1),C2,"")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first Table loads fine, however once it hits the second table I get errors&lt;/P&gt;&lt;P&gt;BOMS:&lt;BR /&gt;load*,&lt;BR /&gt;Order_Number__SDDOCO &amp;amp; Order_Type__SDDCTO &amp;amp; Line_Number__SDLNID as Concat,&lt;BR /&gt;if(COMPONENT_TOTAL&amp;lt;=QOH,'InventoryAvailable','InventoryShort')as InventoryStatus&lt;BR /&gt;;&lt;BR /&gt;SQL ...;&lt;/P&gt;&lt;P&gt;&lt;U&gt;When I add these lines,&amp;nbsp; it errors:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Shortage:&lt;BR /&gt;Load*,&lt;BR /&gt;count(Inventorystatus &amp;lt;'InventoryShort'&amp;gt; Concat) as InventoryShortages&amp;nbsp;&amp;nbsp;&lt;BR /&gt;resident BOMS;&lt;BR /&gt;drop table BOMS;&lt;BR /&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load*;&lt;BR /&gt;If(InventoryShortages=0 , WorkOrderIssue',if(InventoryShortages=1,'ComponentIssue',if(InventoryShortages&amp;gt;1,'MultipleComponentIssue',''))) as IssueType,&lt;BR /&gt;if(InventoryStatus='InventoryShort' and InventoryShortages=1,IXITM__Component_Item_Number_Short,'') as LowerLevel&lt;BR /&gt;resident Shortage;&lt;BR /&gt;drop table Shortage;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="11-13-2019 1-44-38 PM.jpg" style="width: 406px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23591i02E52FD4602658A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="11-13-2019 1-44-38 PM.jpg" alt="11-13-2019 1-44-38 PM.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="11-13-2019 1-44-48 PM.jpg" style="width: 937px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23592iD6AF80F62242D469/image-size/large?v=v2&amp;amp;px=999" role="button" title="11-13-2019 1-44-48 PM.jpg" alt="11-13-2019 1-44-48 PM.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:57:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646636#M594006</guid>
      <dc:creator>nburton78</dc:creator>
      <dc:date>2024-11-16T01:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646694#M594007</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you send me 1 row of your excel, I can help you write the QV code.&lt;/P&gt;&lt;P&gt;Probably this part:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shortage:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load*,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;count(Inventorystatus &amp;lt;'InventoryShort'&amp;gt; Concat) as InventoryShortages&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resident BOMS;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;needs to look like that:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shortage:&lt;BR /&gt;Load&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;count([Concat]) as InventoryShortages&amp;nbsp;&amp;nbsp;&lt;BR /&gt;resident BOMS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;WHERE InventoryStatus='InventoryShort'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This will create a table with single column and single value for all Inventory Shortages.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need some more information to help you get all of it right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Like is it the Total Inventory shortages that you need or is the Inventory shortages per Store for example or per issue type?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;S.T.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 21:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646694#M594007</guid>
      <dc:creator>Stoyan_Terziev</dc:creator>
      <dc:date>2019-11-13T21:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646918#M594008</link>
      <description>&lt;P&gt;I'm looking to count all shortages per distinct concat.&amp;nbsp; So a concat can occur a number of times in the column, and I just want to know how many shortages occur.&amp;nbsp; This is what I'm looking to do.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Concat&lt;/TD&gt;&lt;TD&gt;InventoryStatus&lt;/TD&gt;&lt;TD&gt;InventoryShortages&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;InventoryAvailable&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;InventoryShort&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;InventoryShort&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;InventoryShort&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;InventoryAvailable&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;InventoryAvailable&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 12:48:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646918#M594008</guid>
      <dc:creator>nburton78</dc:creator>
      <dc:date>2019-11-14T12:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646927#M594009</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you try an approach like this one:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	MapNoOfShortages:
	MAPPING LOAD
		Concat,
		Count(Concat)
	FROM [sample.xlsx]
	(ooxml, embedded labels, table is [BOMS Table])
	WHERE InventoryStatus='InventoryShort'
	GROUP BY
		Concat
	;

	BOMS:
	LOAD Order_Number__SDDOCO, 
	     Order_Type__SDDCTO, 
	     Line_Number__SDLNID, 
	     Concat, 
	     IXKITL__Parent_Item_New, 
	     IXITM__Component_Item_Number_Short, 
	     IBSTKT__Stocking_Type, 
	     COMPONENT_TOTAL, 
	     QOH, 
	     Scheduled_Pick_Date__SDPDDJ,
	     InventoryStatus,
	     ApplyMap('MapNoOfShortages', Concat, 0) as [Inventory Shortage],
	     IF(ApplyMap('MapNoOfShortages', Concat, 0)=0, 'Workorderissue'
	     ,	IF(ApplyMap('MapNoOfShortages', Concat, 0)=1,'ComponentIssue'
	     , 'MultipleComponents')) as [ISSUE TYPE],
	     IF(COMPONENT_TOTAL&amp;gt;QOH,IXITM__Component_Item_Number_Short,'') as Lowerlevel
	FROM [sample.xlsx]
	(ooxml, embedded labels, table is [BOMS Table])
	;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;S.T.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 13:03:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646927#M594009</guid>
      <dc:creator>Stoyan_Terziev</dc:creator>
      <dc:date>2019-11-14T13:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646956#M594010</link>
      <description>&lt;P&gt;currently my script looks like this:&lt;/P&gt;&lt;P&gt;BOMS:&lt;BR /&gt;load*,&lt;BR /&gt;Order_Number__SDDOCO &amp;amp; Order_Type__SDDCTO &amp;amp; Line_Number__SDLNID as Concat,&lt;BR /&gt;if(COMPONENT_TOTAL&amp;lt;=QOH,'InventoryAvailable','InventoryShort')as InventoryStatus&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would I add this after my original BOMS table?&amp;nbsp; replacing the "from sample" line with my sql?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 13:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646956#M594010</guid>
      <dc:creator>nburton78</dc:creator>
      <dc:date>2019-11-14T13:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646961#M594011</link>
      <description>&lt;P&gt;(Edit as I forgot the filter)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then we need to add &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;this&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BOMS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;load*,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Order_Number__SDDOCO &amp;amp; Order_Type__SDDCTO &amp;amp; Line_Number__SDLNID as Concat,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(COMPONENT_TOTAL&amp;lt;=QOH,'InventoryAvailable','InventoryShort')as InventoryStatus&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SQL SELECT...;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;LEFT JOIN (BOMS)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;LOAD&lt;BR /&gt;Concat,&lt;BR /&gt;Count(Concat) as&amp;nbsp;[Inventory Shortage]&lt;BR /&gt;RESIDENT&amp;nbsp;BOMS&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;WHERE&amp;nbsp;&lt;SPAN&gt;InventoryStatus='InventoryShort'&lt;/SPAN&gt;&lt;BR /&gt;GROUP BY&lt;BR /&gt;Concat&lt;BR /&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 13:33:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646961#M594011</guid>
      <dc:creator>Stoyan_Terziev</dc:creator>
      <dc:date>2019-11-14T13:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646970#M594012</link>
      <description>&lt;P&gt;You need a Group By for the query with Count:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shortage:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;STRONG&gt;count&lt;/STRONG&gt;(Inventorystatus &amp;lt;'InventoryShort'&amp;gt; Concat) as InventoryShortages&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;resident BOMS&lt;BR /&gt;Group By ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You need to list all the fields except&amp;nbsp;&lt;SPAN&gt;Concat in the LOAD and Group By clauses where I have placed the ellipses.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 13:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1646970#M594012</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-11-14T13:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1647116#M594013</link>
      <description>&lt;P&gt;This works for counting the shortages perfectly.&amp;nbsp; Now I need to be able to classify by the shortage count&amp;nbsp; and then name the shorted component:&lt;/P&gt;&lt;P&gt;if(InventoryShortage=0, "WorkOrder", if "inventoryShortage=1,"ComponentIssue"....&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;P&gt;If (InventoryShortage=1 and QOH&amp;lt;ComponenentTotal, ItemShortNumber, blank)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should this be done with a resident table?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 16:13:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1647116#M594013</guid>
      <dc:creator>nburton78</dc:creator>
      <dc:date>2019-11-14T16:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax errors when joining tables in Script</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1647126#M594014</link>
      <description>&lt;P&gt;I wrote the final table like this and it seems to be working, thank you for all the help and guidance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Final:&lt;BR /&gt;Load*,&lt;BR /&gt;IF([Inventory Shortage]=1 and QOH&amp;lt;COMPONENT_TOTAL, IXITM__Component_Item_Number_Short,0) as LowerLevel,&lt;BR /&gt;IF([Inventory Shortage]=0,'WorkOrderIssue',if([Inventory Shortage]=1,'ComponentIssue',if([Inventory Shortage]&amp;gt;1,'MultipleComponentIssue','')))as IssueType&lt;BR /&gt;resident BOMS;&lt;BR /&gt;drop table BOMS;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 16:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-errors-when-joining-tables-in-Script/m-p/1647126#M594014</guid>
      <dc:creator>nburton78</dc:creator>
      <dc:date>2019-11-14T16:30:54Z</dc:date>
    </item>
  </channel>
</rss>

