<?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: SQL Connection and Script Format in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554609#M39975</link>
    <description>Qlik has Crosstable function&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/crosstable.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/crosstable.htm&lt;/A&gt;&lt;BR /&gt;</description>
    <pubDate>Sun, 10 Mar 2019 18:02:46 GMT</pubDate>
    <dc:creator>bing_jville</dc:creator>
    <dc:date>2019-03-10T18:02:46Z</dc:date>
    <item>
      <title>SQL Connection and Script Format</title>
      <link>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554425#M39933</link>
      <description>&lt;P&gt;I have a table of data that is populated as such:&lt;/P&gt;&lt;P&gt;UserID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PropertyName&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; PropertyValue&lt;/P&gt;&lt;P&gt;1234&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;FristName&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; John&lt;/P&gt;&lt;P&gt;1234&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;LastName&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; Smith&lt;/P&gt;&lt;P&gt;1234&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; City&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;Omaha&lt;/P&gt;&lt;P&gt;1234&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;Street&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;Pine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I structure my script so as to get a more traditional table such as below&lt;/P&gt;&lt;P&gt;User ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FirstName&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; LastName&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; City&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Street&lt;/P&gt;&lt;P&gt;1234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;John&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;Smith&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Omaha&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pine&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 19:24:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554425#M39933</guid>
      <dc:creator>EvanBarrick</dc:creator>
      <dc:date>2019-03-08T19:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Connection and Script Format</title>
      <link>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554489#M39942</link>
      <description>Hi there&lt;BR /&gt;&lt;BR /&gt;I don't have QS open so can't validate syntax, but try something like:&lt;BR /&gt;&lt;BR /&gt;Temp:&lt;BR /&gt;Load&lt;BR /&gt;*&lt;BR /&gt;From YOURTABLE;&lt;BR /&gt;&lt;BR /&gt;Noconcatenate&lt;BR /&gt;Newtable:&lt;BR /&gt;Load Distinct&lt;BR /&gt;UserId&lt;BR /&gt;Resident Temp;&lt;BR /&gt;&lt;BR /&gt;Left join (NewTable)&lt;BR /&gt;Load&lt;BR /&gt;UserId,&lt;BR /&gt;PropertyValue As Firstname&lt;BR /&gt;Resident Temp&lt;BR /&gt;Where&lt;BR /&gt;PropertyName = 'Firstname';&lt;BR /&gt;&lt;BR /&gt;Left join (NewTable)&lt;BR /&gt;Load&lt;BR /&gt;UserId,&lt;BR /&gt;PropertyValue As Lastname&lt;BR /&gt;Resident Temp&lt;BR /&gt;Where&lt;BR /&gt;PropertyName = 'Lastname';&lt;BR /&gt;&lt;BR /&gt;Left join (NewTable)&lt;BR /&gt;Load&lt;BR /&gt;UserId,&lt;BR /&gt;PropertyValue As City&lt;BR /&gt;Resident Temp&lt;BR /&gt;Where&lt;BR /&gt;PropertyName = 'City';&lt;BR /&gt;&lt;BR /&gt;Left join (NewTable)&lt;BR /&gt;Load&lt;BR /&gt;UserId,&lt;BR /&gt;PropertyValue As Street&lt;BR /&gt;Resident Temp&lt;BR /&gt;Where&lt;BR /&gt;PropertyName = 'Street';&lt;BR /&gt;&lt;BR /&gt;Drop Table Temp;&lt;BR /&gt;&lt;BR /&gt;If you will have a dynamic number of PropertyNames then you can load a list of distinct PropertyNames into a table and loop through them and left joining the PropertyName to the existing table every time.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;Mauritz</description>
      <pubDate>Fri, 08 Mar 2019 21:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554489#M39942</guid>
      <dc:creator>Mauritz_SA</dc:creator>
      <dc:date>2019-03-08T21:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Connection and Script Format</title>
      <link>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554500#M39946</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to use Generic Load and then Combine the resultant Tables. You can follow this simple code and execute in DEBUG mode to understand more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Temp:
LOAD * INLINE [
    UserID, PropertyName, PropertyValue
    1234, City, Omaha
    1234, FristName, John
    1234, LastName, Smith
    1234, Street, Pine
];

Test:
LOAD 
Distinct UserID
Resident Temp;

Test_Gen:
Generic Load *
Resident Temp;

FOR i = NoOfTables()-1 to 0 STEP -1 
  LET vTable=TableName($(i)); 
  IF WildMatch('$(vTable)', 'Test_Gen.*') THEN 
    LEFT JOIN (Test) LOAD * RESIDENT    [$(vTable)]; 
    DROP TABLE  [$(vTable)]; 
  ENDIF 
NEXT i

DROP Table Temp;
vTable=;

Exit SCRIPT;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 22:55:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554500#M39946</guid>
      <dc:creator>jayanttibhe</dc:creator>
      <dc:date>2019-03-08T22:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Connection and Script Format</title>
      <link>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554609#M39975</link>
      <description>Qlik has Crosstable function&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/crosstable.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/February2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/crosstable.htm&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 10 Mar 2019 18:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/SQL-Connection-and-Script-Format/m-p/1554609#M39975</guid>
      <dc:creator>bing_jville</dc:creator>
      <dc:date>2019-03-10T18:02:46Z</dc:date>
    </item>
  </channel>
</rss>

