<?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: How to use an earlier retrieved column in previous SQL? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497634#M691181</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did use a LEFT JOIN but the performance was horrible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static_Info_1:&lt;/P&gt;&lt;P&gt;SQL select "VOYAGE"."ABBR_VESSEL_M", "VOYAGE"."VV_C", "SERVICE_C", "ETB_DT", "ETU_DT", "VOYAGE_IN_N", "VOYAGE_OUT_N", "BERTH_SEQ_N", "BERTH_M", "CNTR_CAPACITY_Q","HATCH_COVER"."TYPE_C" AS "HATCH_COVER","BERTH_ALLOCATION"."TERMINAL_C", "VESSEL"."CLASS_N"&lt;/P&gt;&lt;P&gt;from "VOYAGE", "BERTH_ALLOCATION", "BERTH","VESSEL", "HATCH_COVER"&lt;/P&gt;&lt;P&gt;where "VOYAGE"."VV_C" = "BERTH_ALLOCATION"."VV_C" and "BERTH_ALLOCATION"."ETB_DT" &amp;gt; trunc(sysdate-4) and "BERTH_ALLOCATION"."ETB_DT" &amp;lt;= trunc(sysdate+5) and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."TERMINAL_C" = "BERTH"."TERMINAL_C" and "BERTH_ALLOCATION"."SECTION_N" = "BERTH"."SECTION_N" and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."BERTH_N" = "BERTH"."BERTH_N" and "VOYAGE"."ABBR_VESSEL_M" != 'BANGKOK E' and "VESSEL"."VESSEL_ID_N" = "VOYAGE"."VESSEL_ID_N"&lt;/P&gt;&lt;P&gt;and "VOYAGE"."ABBR_VESSEL_M" = "VESSEL"."ABBR_VESSEL_M" and "VESSEL"."CLASS_N" = "HATCH_COVER"."CLASS_N";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static_Info_2:&lt;/P&gt;&lt;P&gt;LEFT JOIN(Static_Info_1)&lt;/P&gt;&lt;P&gt;SQL select "STD_BAY_N", "BAY_N", "SIZE_Q", "LCG_Q" from "VESSEL_BAY";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The column to join is "CLASS_N"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What did I do wrong here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;===========================================================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked up the reference manual of QlikView. It says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select [ all | distinct | distinctrow | top n [ percent ] ] *fieldlist&lt;/P&gt;&lt;P&gt;from tablelist&lt;/P&gt;&lt;P&gt;[ where criterion ]&lt;/P&gt;&lt;P&gt;[ group by fieldlist [ having criterion ] ]&lt;/P&gt;&lt;P&gt;[ order by fieldlist [ asc | desc ] ]&lt;/P&gt;&lt;P&gt;[ &lt;STRONG&gt;( inner | left | right | full ) join&lt;/STRONG&gt; tablename on fieldref = fieldref&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I run this particular SQL, it says command not properly ended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL select "VOYAGE"."ABBR_VESSEL_M", "VOYAGE"."VV_C", "SERVICE_C", "ETB_DT", "ETU_DT", "VOYAGE_IN_N", "VOYAGE_OUT_N", "BERTH_SEQ_N", "BERTH_M", "CNTR_CAPACITY_Q","HATCH_COVER"."TYPE_C" AS "HATCH_COVER","BERTH_ALLOCATION"."TERMINAL_C", "VESSEL"."CLASS_N"&lt;/P&gt;&lt;P&gt;from "VOYAGE", "BERTH_ALLOCATION", "BERTH","VESSEL", "HATCH_COVER"&lt;/P&gt;&lt;P&gt;where "VOYAGE"."VV_C" = "BERTH_ALLOCATION"."VV_C" and "BERTH_ALLOCATION"."ETB_DT" &amp;gt; trunc(sysdate-4) and "BERTH_ALLOCATION"."ETB_DT" &amp;lt;= trunc(sysdate+5) and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."TERMINAL_C" = "BERTH"."TERMINAL_C" and "BERTH_ALLOCATION"."SECTION_N" = "BERTH"."SECTION_N" and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."BERTH_N" = "BERTH"."BERTH_N" and "VOYAGE"."ABBR_VESSEL_M" != 'BANGKOK E' and "VESSEL"."VESSEL_ID_N" = "VOYAGE"."VESSEL_ID_N"&lt;/P&gt;&lt;P&gt;and "VOYAGE"."ABBR_VESSEL_M" = "VESSEL"."ABBR_VESSEL_M" and "VESSEL"."CLASS_N" = "HATCH_COVER"."CLASS_N" &lt;STRONG&gt;left join "VESSEL_BAY" on "CLASS_N" = "VESSEL"."CLASS_N";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Sep 2013 10:44:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-19T10:44:17Z</dc:date>
    <item>
      <title>How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497627#M691174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I know how to use an earlier retrieved column in previous SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;E.g.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vv_c,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vr_create_dt,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vr_type_c,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vr_remark_x&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Data\vessel_remark.csv]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Then in another SQL, I want to use say earlier retrieved vv_c.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;select "CREATE_DT", "TYPE_C","REMARK_X"&lt;BR /&gt;from "VESSEL_REMARK"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;where "VESSEL_REMARK"."VV_C" = &lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;EARLIER_RETRIEVED_VV_C&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;How to retrieve the &lt;STRONG&gt;&lt;EM style="text-decoration: underline;"&gt;EARLIER_RETRIEVED_VV_C ??&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 05:59:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497627#M691174</guid>
      <dc:creator />
      <dc:date>2013-09-09T05:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497628#M691175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Store the vaule in a variable like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vRemark=Peek('vv_c');&lt;/P&gt;&lt;P&gt;And then try using this variable in the SQL where cluase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 06:11:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497628#M691175</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-09T06:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497629#M691176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Do you mean something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Let vRemark = Peek('vv_c');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;select "CREATE_DT", "TYPE_C","REMARK_X"&lt;BR /&gt;from "VESSEL_REMARK"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;where "VESSEL_REMARK"."VV_C" = &lt;STRONG style="text-decoration: underline;"&gt;$(vRemark)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 06:17:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497629#M691176</guid>
      <dc:creator />
      <dc:date>2013-09-09T06:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497630#M691177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try putting single quotes around the variable expansion like : "VESSEL_REMARK"."VV_C" = '&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;$(vRemark)';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Remeber,&lt;/STRONG&gt; here your variable will hold the last value in that field. If you want to take all the values in the field 'vv_c', you have to use EXISTS() function, but that would not work in SQL part.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 06:23:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497630#M691177</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-09T06:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497631#M691178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Remeber,&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; here your variable will hold the last value in that field.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually need the whole set of values in field vv_c. That means I want to retrieve data for all those vv_c records, not just the last value. How to achieve in this case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 06:25:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497631#M691178</guid>
      <dc:creator />
      <dc:date>2013-09-09T06:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497632#M691179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve&lt;/P&gt;&lt;P&gt;The suggestions below works good as long as you have only 1 previous value.&lt;/P&gt;&lt;P&gt;If you have more you will need a loop, but this is hard work and similar to simple Join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This lead to the question : Is there any reason you don't join both tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 06:27:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497632#M691179</guid>
      <dc:creator>orital81</dc:creator>
      <dc:date>2013-09-09T06:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497633#M691180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;In that case you have to load all the data from DB using SQL, then filter in qv using exists() like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vv_c,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vr_create_dt,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vr_type_c,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vr_remark_x&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Data\vessel_remark.csv]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FilteredData: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Load * Where Exists(VV_C,vv_c);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;select "CREATE_DT", "TYPE_C","REMARK_X", "VV_C"&lt;BR /&gt;from "VESSEL_REMARK";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 06:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497633#M691180</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-09T06:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497634#M691181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did use a LEFT JOIN but the performance was horrible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static_Info_1:&lt;/P&gt;&lt;P&gt;SQL select "VOYAGE"."ABBR_VESSEL_M", "VOYAGE"."VV_C", "SERVICE_C", "ETB_DT", "ETU_DT", "VOYAGE_IN_N", "VOYAGE_OUT_N", "BERTH_SEQ_N", "BERTH_M", "CNTR_CAPACITY_Q","HATCH_COVER"."TYPE_C" AS "HATCH_COVER","BERTH_ALLOCATION"."TERMINAL_C", "VESSEL"."CLASS_N"&lt;/P&gt;&lt;P&gt;from "VOYAGE", "BERTH_ALLOCATION", "BERTH","VESSEL", "HATCH_COVER"&lt;/P&gt;&lt;P&gt;where "VOYAGE"."VV_C" = "BERTH_ALLOCATION"."VV_C" and "BERTH_ALLOCATION"."ETB_DT" &amp;gt; trunc(sysdate-4) and "BERTH_ALLOCATION"."ETB_DT" &amp;lt;= trunc(sysdate+5) and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."TERMINAL_C" = "BERTH"."TERMINAL_C" and "BERTH_ALLOCATION"."SECTION_N" = "BERTH"."SECTION_N" and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."BERTH_N" = "BERTH"."BERTH_N" and "VOYAGE"."ABBR_VESSEL_M" != 'BANGKOK E' and "VESSEL"."VESSEL_ID_N" = "VOYAGE"."VESSEL_ID_N"&lt;/P&gt;&lt;P&gt;and "VOYAGE"."ABBR_VESSEL_M" = "VESSEL"."ABBR_VESSEL_M" and "VESSEL"."CLASS_N" = "HATCH_COVER"."CLASS_N";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static_Info_2:&lt;/P&gt;&lt;P&gt;LEFT JOIN(Static_Info_1)&lt;/P&gt;&lt;P&gt;SQL select "STD_BAY_N", "BAY_N", "SIZE_Q", "LCG_Q" from "VESSEL_BAY";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The column to join is "CLASS_N"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What did I do wrong here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;===========================================================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked up the reference manual of QlikView. It says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select [ all | distinct | distinctrow | top n [ percent ] ] *fieldlist&lt;/P&gt;&lt;P&gt;from tablelist&lt;/P&gt;&lt;P&gt;[ where criterion ]&lt;/P&gt;&lt;P&gt;[ group by fieldlist [ having criterion ] ]&lt;/P&gt;&lt;P&gt;[ order by fieldlist [ asc | desc ] ]&lt;/P&gt;&lt;P&gt;[ &lt;STRONG&gt;( inner | left | right | full ) join&lt;/STRONG&gt; tablename on fieldref = fieldref&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I run this particular SQL, it says command not properly ended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL select "VOYAGE"."ABBR_VESSEL_M", "VOYAGE"."VV_C", "SERVICE_C", "ETB_DT", "ETU_DT", "VOYAGE_IN_N", "VOYAGE_OUT_N", "BERTH_SEQ_N", "BERTH_M", "CNTR_CAPACITY_Q","HATCH_COVER"."TYPE_C" AS "HATCH_COVER","BERTH_ALLOCATION"."TERMINAL_C", "VESSEL"."CLASS_N"&lt;/P&gt;&lt;P&gt;from "VOYAGE", "BERTH_ALLOCATION", "BERTH","VESSEL", "HATCH_COVER"&lt;/P&gt;&lt;P&gt;where "VOYAGE"."VV_C" = "BERTH_ALLOCATION"."VV_C" and "BERTH_ALLOCATION"."ETB_DT" &amp;gt; trunc(sysdate-4) and "BERTH_ALLOCATION"."ETB_DT" &amp;lt;= trunc(sysdate+5) and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."TERMINAL_C" = "BERTH"."TERMINAL_C" and "BERTH_ALLOCATION"."SECTION_N" = "BERTH"."SECTION_N" and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."BERTH_N" = "BERTH"."BERTH_N" and "VOYAGE"."ABBR_VESSEL_M" != 'BANGKOK E' and "VESSEL"."VESSEL_ID_N" = "VOYAGE"."VESSEL_ID_N"&lt;/P&gt;&lt;P&gt;and "VOYAGE"."ABBR_VESSEL_M" = "VESSEL"."ABBR_VESSEL_M" and "VESSEL"."CLASS_N" = "HATCH_COVER"."CLASS_N" &lt;STRONG&gt;left join "VESSEL_BAY" on "CLASS_N" = "VESSEL"."CLASS_N";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 10:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497634#M691181</guid>
      <dc:creator />
      <dc:date>2013-09-19T10:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497635#M691182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;A href="https://community.qlik.com/people/tresesco"&gt;tresesco&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Base on your suggestion, I tried the following but I hit error. How do I load all the values in say "ABBR_VESSEL_M" for use in the next SQL in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static_Info_1:&lt;/P&gt;&lt;P&gt;SQL select "VOYAGE"."ABBR_VESSEL_M", "VOYAGE"."VV_C", "SERVICE_C", "ETB_DT", "ETU_DT", "VOYAGE_IN_N", "VOYAGE_OUT_N", "BERTH_SEQ_N", "BERTH_M", "CNTR_CAPACITY_Q","HATCH_COVER"."TYPE_C" AS "HATCH_COVER","BERTH_ALLOCATION"."TERMINAL_C", "VESSEL"."CLASS_N"&lt;/P&gt;&lt;P&gt;from "VOYAGE", "BERTH_ALLOCATION", "BERTH","VESSEL", "HATCH_COVER"&lt;/P&gt;&lt;P&gt;where "VOYAGE"."VV_C" = "BERTH_ALLOCATION"."VV_C" and "BERTH_ALLOCATION"."ETB_DT" &amp;gt; trunc(sysdate-4) and "BERTH_ALLOCATION"."ETB_DT" &amp;lt;= trunc(sysdate+5) and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."TERMINAL_C" = "BERTH"."TERMINAL_C" and "BERTH_ALLOCATION"."SECTION_N" = "BERTH"."SECTION_N" and&lt;/P&gt;&lt;P&gt;"BERTH_ALLOCATION"."BERTH_N" = "BERTH"."BERTH_N" and "VOYAGE"."ABBR_VESSEL_M" != 'BANGKOK E' and "VESSEL"."VESSEL_ID_N" = "VOYAGE"."VESSEL_ID_N"&lt;/P&gt;&lt;P&gt;and "VOYAGE"."ABBR_VESSEL_M" = "VESSEL"."ABBR_VESSEL_M" and "VESSEL"."CLASS_N" = "HATCH_COVER"."CLASS_N";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;Load * where exists (CLASS_N, "ABBR_VESSEL_M");&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 10:58:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497635#M691182</guid>
      <dc:creator />
      <dc:date>2013-09-19T10:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an earlier retrieved column in previous SQL?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497636#M691183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve&lt;/P&gt;&lt;P&gt;I suggest to run the SQL first on a common SQL tool (SQL Server, PLSQL Developer, or any other tool).&lt;/P&gt;&lt;P&gt;There you will be able to get a more detailed error for youe querry and analyse what is wrong.&lt;/P&gt;&lt;P&gt;on which database do you run the querry (Orvacle / SQL Server?)&lt;/P&gt;&lt;P&gt;Also, why don't you select the raw data of the tables into QVD and then join QVDs?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Sep 2013 18:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-an-earlier-retrieved-column-in-previous-SQL/m-p/497636#M691183</guid>
      <dc:creator>orital81</dc:creator>
      <dc:date>2013-09-21T18:54:54Z</dc:date>
    </item>
  </channel>
</rss>

