<?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: Field not Found in For Each statement but found when hard-coded in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Field-not-Found-in-For-Each-statement-but-found-when-hard-coded/m-p/1682155#M593840</link>
    <description>&lt;P&gt;Thanks Jochem_zw.&amp;nbsp; I knew it would be something silly I was missing (though could have sworn I'd tried that already!)&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 15:55:06 GMT</pubDate>
    <dc:creator>hartleyr</dc:creator>
    <dc:date>2020-03-05T15:55:06Z</dc:date>
    <item>
      <title>Field not Found in For Each statement but found when hard-coded</title>
      <link>https://community.qlik.com/t5/QlikView/Field-not-Found-in-For-Each-statement-but-found-when-hard-coded/m-p/1682030#M593838</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I have an incredibly frustrating issue with my script.&amp;nbsp; I'm trying to use a for each statement with a where clause, and it doesn't matter how i write it, I'm getting 'field not found - LINL1'.&amp;nbsp; If I hard code this information into the script, it works fine.&lt;/P&gt;&lt;P&gt;I'm assuming I'm doing something stupid... If anyone can help shed any light, it'd be greatly appreciated....&lt;/P&gt;&lt;P&gt;Here is my script.&amp;nbsp; FlowRate works fine, but Results doesn't;&lt;/P&gt;&lt;P&gt;For Each vSchema in '5', '2';&lt;BR /&gt;FlowRate:&lt;BR /&gt;LOAD @1 as DateTime,&lt;BR /&gt;@2 as [Flow Rate],&lt;BR /&gt;$(vSchema) as Pump&lt;BR /&gt;FROM&lt;BR /&gt;$(vInputPath)Environmental\Renewi - Pump Station $(vSchema)*.csv&lt;BR /&gt;(txt, codepage is 28591, no labels, delimiter is ',', msq, header is 1 lines);&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;store * from FlowRate into $(vOutputPath)Flow Rates.qvd (qvd);&lt;BR /&gt;drop table FlowRate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each vSample in 'LINL1','LINL2','LINSD';&lt;BR /&gt;Results:&lt;/P&gt;&lt;P&gt;LOAD [Parameter:],&lt;BR /&gt;[Date:],&lt;BR /&gt;[Operator ID:],&lt;BR /&gt;[Sample ID:],&lt;BR /&gt;[Sample ID:]&amp;amp;'_'&amp;amp;Program AS %SampleKey,&lt;BR /&gt;[Sample Number],&lt;BR /&gt;Program,&lt;BR /&gt;Result,&lt;BR /&gt;Unit,&lt;BR /&gt;Name,&lt;BR /&gt;Error,&lt;BR /&gt;Wavelength,&lt;BR /&gt;Value,&lt;BR /&gt;Unit1,&lt;BR /&gt;Dilution&lt;BR /&gt;FROM&lt;BR /&gt;$(vInputPath)Environmental\Lingerton*.xlsm&lt;BR /&gt;(ooxml, embedded labels, table is Raw_data)&lt;BR /&gt;where Program = 302 and upper([Sample ID:])= $(vSample)&lt;BR /&gt;;&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;store * from Results into $(vOutputPath)Ammonia Results.qvd (qvd);&lt;BR /&gt;drop table Results;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change the script to this and it works???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//For each vSample in 'LINL1','LINL2','LINSD';&lt;/P&gt;&lt;P&gt;Results:&lt;/P&gt;&lt;P&gt;LOAD [Parameter:],&lt;BR /&gt;[Date:],&lt;BR /&gt;[Operator ID:],&lt;BR /&gt;[Sample ID:],&lt;BR /&gt;[Sample ID:]&amp;amp;'_'&amp;amp;Program AS %SampleKey,&lt;BR /&gt;[Sample Number],&lt;BR /&gt;Program,&lt;BR /&gt;Result,&lt;BR /&gt;Unit,&lt;BR /&gt;Name,&lt;BR /&gt;Error,&lt;BR /&gt;Wavelength,&lt;BR /&gt;Value,&lt;BR /&gt;Unit1,&lt;BR /&gt;Dilution&lt;BR /&gt;FROM&lt;BR /&gt;$(vInputPath)Environmental\Lingerton*.xlsm&lt;BR /&gt;(ooxml, embedded labels, table is Raw_data)&lt;BR /&gt;where Program = 302 and [Sample ID:]= &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;'LINL1'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;//Next&lt;BR /&gt;store * from Results into $(vOutputPath)Ammonia Results.qvd (qvd);&lt;BR /&gt;drop table Results;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:07:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Field-not-Found-in-For-Each-statement-but-found-when-hard-coded/m-p/1682030#M593838</guid>
      <dc:creator>hartleyr</dc:creator>
      <dc:date>2024-11-16T01:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Field not Found in For Each statement but found when hard-coded</title>
      <link>https://community.qlik.com/t5/QlikView/Field-not-Found-in-For-Each-statement-but-found-when-hard-coded/m-p/1682133#M593839</link>
      <description>&lt;P&gt;the where statement should be:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where Program = 302 and upper([Sample ID:])= '$(vSample)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so add the quotes&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:11:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Field-not-Found-in-For-Each-statement-but-found-when-hard-coded/m-p/1682133#M593839</guid>
      <dc:creator>jochem_zw</dc:creator>
      <dc:date>2020-03-05T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Field not Found in For Each statement but found when hard-coded</title>
      <link>https://community.qlik.com/t5/QlikView/Field-not-Found-in-For-Each-statement-but-found-when-hard-coded/m-p/1682155#M593840</link>
      <description>&lt;P&gt;Thanks Jochem_zw.&amp;nbsp; I knew it would be something silly I was missing (though could have sworn I'd tried that already!)&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:55:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Field-not-Found-in-For-Each-statement-but-found-when-hard-coded/m-p/1682155#M593840</guid>
      <dc:creator>hartleyr</dc:creator>
      <dc:date>2020-03-05T15:55:06Z</dc:date>
    </item>
  </channel>
</rss>

