<?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 Generic Load Script Logic in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Generic-Load-Script-Logic/m-p/1677547#M449844</link>
    <description>&lt;P&gt;Good morning all,&lt;/P&gt;&lt;P&gt;Need a little help with my script logic.&amp;nbsp; I have built the following generic load and need some help on merging the 2 tables to 1.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;Temp2:&lt;BR /&gt;Load&lt;BR /&gt;Ship_accountid as ShipTo,&lt;BR /&gt;ContractStart_Year as Start_YR,&lt;BR /&gt;Count(distinct(opportunityid)) as NoOpptunities&lt;BR /&gt;Resident Opportunity&lt;BR /&gt;Group by Ship_accountid, ContractStart_Year&lt;BR /&gt;;&lt;BR /&gt;Temp3:&lt;BR /&gt;Generic Load&lt;BR /&gt;ShipTo,&lt;BR /&gt;Start_YR,&lt;BR /&gt;NoOpptunities&lt;BR /&gt;Resident Temp2;&lt;/P&gt;&lt;P&gt;Drop Tables Temp2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;I have tried this logic but it takes all the tables in my model and I only want the ones from the generic load.&lt;/P&gt;&lt;P&gt;Let vNoOfTables = NoOfTables();&lt;/P&gt;&lt;P&gt;For cnt=0 to $(vNoOfTables)-1&lt;/P&gt;&lt;P&gt;Let vTableName=TableName($(cnt));&lt;BR /&gt;&lt;BR /&gt;TableOverview:&lt;BR /&gt;LOAD&lt;BR /&gt;'$(vTableName)' as TableName //create a field to get the table names&lt;BR /&gt;Autogenerate(1);&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;//Create one table&lt;/P&gt;&lt;P&gt;Let vTableNameFirst=Peek('TableName',0,'TableOverview');&lt;BR /&gt;Let vNumberOfRows = NoOfRows('TableOverview')-1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For cnt=1 to $(vNumberOfRows)&lt;/P&gt;&lt;P&gt;Let vTableName=Peek('TableName',$(cnt),'TableOverview');&lt;/P&gt;&lt;P&gt;Join($(vTableNameFirst))&lt;BR /&gt;LOAD * Resident $(vTableName);&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;//The part below could/should be also solved with a loop&lt;/P&gt;&lt;P&gt;Drop Table 'Temp3.2019',&lt;BR /&gt;'Temp3.2020'&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:13:49 GMT</pubDate>
    <dc:creator>tmumaw</dc:creator>
    <dc:date>2024-11-16T01:13:49Z</dc:date>
    <item>
      <title>Generic Load Script Logic</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-Load-Script-Logic/m-p/1677547#M449844</link>
      <description>&lt;P&gt;Good morning all,&lt;/P&gt;&lt;P&gt;Need a little help with my script logic.&amp;nbsp; I have built the following generic load and need some help on merging the 2 tables to 1.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;Temp2:&lt;BR /&gt;Load&lt;BR /&gt;Ship_accountid as ShipTo,&lt;BR /&gt;ContractStart_Year as Start_YR,&lt;BR /&gt;Count(distinct(opportunityid)) as NoOpptunities&lt;BR /&gt;Resident Opportunity&lt;BR /&gt;Group by Ship_accountid, ContractStart_Year&lt;BR /&gt;;&lt;BR /&gt;Temp3:&lt;BR /&gt;Generic Load&lt;BR /&gt;ShipTo,&lt;BR /&gt;Start_YR,&lt;BR /&gt;NoOpptunities&lt;BR /&gt;Resident Temp2;&lt;/P&gt;&lt;P&gt;Drop Tables Temp2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;I have tried this logic but it takes all the tables in my model and I only want the ones from the generic load.&lt;/P&gt;&lt;P&gt;Let vNoOfTables = NoOfTables();&lt;/P&gt;&lt;P&gt;For cnt=0 to $(vNoOfTables)-1&lt;/P&gt;&lt;P&gt;Let vTableName=TableName($(cnt));&lt;BR /&gt;&lt;BR /&gt;TableOverview:&lt;BR /&gt;LOAD&lt;BR /&gt;'$(vTableName)' as TableName //create a field to get the table names&lt;BR /&gt;Autogenerate(1);&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;//Create one table&lt;/P&gt;&lt;P&gt;Let vTableNameFirst=Peek('TableName',0,'TableOverview');&lt;BR /&gt;Let vNumberOfRows = NoOfRows('TableOverview')-1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For cnt=1 to $(vNumberOfRows)&lt;/P&gt;&lt;P&gt;Let vTableName=Peek('TableName',$(cnt),'TableOverview');&lt;/P&gt;&lt;P&gt;Join($(vTableNameFirst))&lt;BR /&gt;LOAD * Resident $(vTableName);&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;//The part below could/should be also solved with a loop&lt;/P&gt;&lt;P&gt;Drop Table 'Temp3.2019',&lt;BR /&gt;'Temp3.2020'&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:13:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-Load-Script-Logic/m-p/1677547#M449844</guid>
      <dc:creator>tmumaw</dc:creator>
      <dc:date>2024-11-16T01:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Load Script Logic</title>
      <link>https://community.qlik.com/t5/QlikView/Generic-Load-Script-Logic/m-p/1687816#M450475</link>
      <description>&lt;P&gt;Hey Thom, not sure if you got anything sorted or not, best I can offer are the following, hopefully may give you some further info to help you figure it out!&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Generic.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Generic.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Sorry I am not more help, but hopefully the Design Blog post may shed some light upon things to where you may be able to figure out what is going wrong and why.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 19:01:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Generic-Load-Script-Logic/m-p/1687816#M450475</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-03-25T19:01:09Z</dc:date>
    </item>
  </channel>
</rss>

