<?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 Load not charging expected value in Management &amp; Governance</title>
    <link>https://community.qlik.com/t5/Management-Governance/Load-not-charging-expected-value/m-p/2138037#M26033</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need your help in understanding what's happening during my load as I'm going crazy with this very unexpected behavior.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the whole load begins with a loop:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Origine:
LOAD ..., MyField FROM my_original file;

for i=1 to fieldvaluecount('MyField')
TRACE la valeur de i est $(i);
let a = FieldValue('MyField',$(i));&lt;/LI-CODE&gt;
&lt;P&gt;inside that loop, I'm loading and dropping successively tables (doing some changes at each step):&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;1: load xxx Resident Origine where MyField = '$(a)';

noconcatenate
2: load xxx resident 1; drop table 1;&lt;/LI-CODE&gt;
&lt;P&gt;I reach this way table 4.&lt;/P&gt;
&lt;P&gt;At this point, if I'm correct, the system handles 2 tables: &lt;EM&gt;Origine&lt;/EM&gt;, which contains all my original data, and a temporary&amp;nbsp;&lt;EM&gt;4&lt;/EM&gt; which contains a subset of it filtered on MyField = '$(a)'&lt;/P&gt;
&lt;P&gt;Now happens the very unexpected behavior.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From this table 4, I'm extracting 2 tables. the 1st works fine, the 2nd not:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;
&lt;P&gt;noconcatenate&lt;/P&gt;
&lt;P&gt;temp_table1: load Field1, Field2 Resident 4;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="50%"&gt;
&lt;P&gt;noconcatenate&lt;/P&gt;
&lt;P&gt;temp_table2: load firstvalue(MyField) as MyField Resident 4&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Output: correct Field1 &amp;amp; Field2 associated to MyField when MyField='$(a)'= FieldValue('MyField',$(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;/FONT&gt;))&lt;/TD&gt;
&lt;TD&gt;Output: wrong MyField value. the loaded value is MyField = '$(a)' = FieldValue('MyField',$(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;)) whatever the actual value of i&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Continuing with the script, after doing some works with my 2 temporary tables, I load again the whole table 4, adding inputs from the above work:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;noconcatenate
5: load * resident 4;
left join load Field1, Field2, NewField resident temp_table1;
drop table temp_table1;
left join load MyField, NewField2 resident temp_table2;
drop table temp_table2;
drop table 4;&lt;/LI-CODE&gt;
&lt;P&gt;in this load, the actual value of MyField coming from table 4 is indeed correct as expected (i.e. if i = 2, I have the right 2nd value).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore I don't understand what is wrong here:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;noconcatenate
temp_table2: load firstvalue(MyField) as MyField Resident 4&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;I tried without "FirstValue" thinking maybe something residuing from the 1st iteration was still here, but no: when I don't put the FirstValue, I do have all the lines of the table, still with the wrong value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is even weirdest, is that I tested to store table 4 (store table 4 into 4.'$(i)'.qvd) and then load my temp_table2 from this stored table, and I've got the exact same result (value always as if i = 1) even if in my stored table I don't have that value... the script is rightfully loading the data from&amp;nbsp;&lt;EM&gt;4.'$(i)'.qvd:&lt;/EM&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Origine &amp;lt;&amp;lt; Sheet1 21 717 Lines fetched
FINAL &amp;lt;&amp;lt; AUTOGENERATE(0) 0 Lines fetched
la valeur de i est 1
1 &amp;lt;&amp;lt; Origine 6 584 Lines fetched
2 &amp;lt;&amp;lt; 1 6 584 Lines fetched
3 &amp;lt;&amp;lt; 2 6 584 Lines fetched
4 &amp;lt;&amp;lt; 3 6 584 Lines fetched
temp_table1 &amp;lt;&amp;lt; 4 502 Lines fetched
temp_table2 &amp;lt;&amp;lt; 4.1 1 Lines fetched
...
5 &amp;lt;&amp;lt; 4 6 584 Lines fetched
FINAL &amp;lt;&amp;lt; 5 6 584 Lines fetched

la valeur de i est 2
1 &amp;lt;&amp;lt; Origine 4 931 Lines fetched
2 &amp;lt;&amp;lt; 1 4 931 Lines fetched
3 &amp;lt;&amp;lt; 2 4 931 Lines fetched
4 &amp;lt;&amp;lt; 3 4 931 Lines fetched
temp_table1 &amp;lt;&amp;lt; 4 562 Lines fetched
temp_table2-5 &amp;lt;&amp;lt; 4.2 1 Lines fetched
...
5 &amp;lt;&amp;lt; 4 4 931 Lines fetched
FINAL &amp;lt;&amp;lt; 5 11 808 Lines fetched&lt;/LI-CODE&gt;
&lt;P&gt;BUT as you might have observed, I have an indented number that appeared when i = 2 on my temp_table2 that I didn't create: temp_table2&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;-5&lt;/STRONG&gt;&lt;FONT color="#000000"&gt; and when I look at the 3rd iteration, that number changes and becomes a 6 "temp_table2-6". I don't know if this is linked, but I don't understand either why that appears.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Any ideas here on the issue are very welcome as, as you can see, only half of the work is rightfully working from table 4.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Thanks a lot everyone for your help!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2023 13:29:55 GMT</pubDate>
    <dc:creator>Delphines</dc:creator>
    <dc:date>2023-11-15T13:29:55Z</dc:date>
    <item>
      <title>Load not charging expected value</title>
      <link>https://community.qlik.com/t5/Management-Governance/Load-not-charging-expected-value/m-p/2138037#M26033</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need your help in understanding what's happening during my load as I'm going crazy with this very unexpected behavior.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the whole load begins with a loop:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Origine:
LOAD ..., MyField FROM my_original file;

for i=1 to fieldvaluecount('MyField')
TRACE la valeur de i est $(i);
let a = FieldValue('MyField',$(i));&lt;/LI-CODE&gt;
&lt;P&gt;inside that loop, I'm loading and dropping successively tables (doing some changes at each step):&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;1: load xxx Resident Origine where MyField = '$(a)';

noconcatenate
2: load xxx resident 1; drop table 1;&lt;/LI-CODE&gt;
&lt;P&gt;I reach this way table 4.&lt;/P&gt;
&lt;P&gt;At this point, if I'm correct, the system handles 2 tables: &lt;EM&gt;Origine&lt;/EM&gt;, which contains all my original data, and a temporary&amp;nbsp;&lt;EM&gt;4&lt;/EM&gt; which contains a subset of it filtered on MyField = '$(a)'&lt;/P&gt;
&lt;P&gt;Now happens the very unexpected behavior.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From this table 4, I'm extracting 2 tables. the 1st works fine, the 2nd not:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;
&lt;P&gt;noconcatenate&lt;/P&gt;
&lt;P&gt;temp_table1: load Field1, Field2 Resident 4;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="50%"&gt;
&lt;P&gt;noconcatenate&lt;/P&gt;
&lt;P&gt;temp_table2: load firstvalue(MyField) as MyField Resident 4&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Output: correct Field1 &amp;amp; Field2 associated to MyField when MyField='$(a)'= FieldValue('MyField',$(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;/FONT&gt;))&lt;/TD&gt;
&lt;TD&gt;Output: wrong MyField value. the loaded value is MyField = '$(a)' = FieldValue('MyField',$(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;)) whatever the actual value of i&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Continuing with the script, after doing some works with my 2 temporary tables, I load again the whole table 4, adding inputs from the above work:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;noconcatenate
5: load * resident 4;
left join load Field1, Field2, NewField resident temp_table1;
drop table temp_table1;
left join load MyField, NewField2 resident temp_table2;
drop table temp_table2;
drop table 4;&lt;/LI-CODE&gt;
&lt;P&gt;in this load, the actual value of MyField coming from table 4 is indeed correct as expected (i.e. if i = 2, I have the right 2nd value).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore I don't understand what is wrong here:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;noconcatenate
temp_table2: load firstvalue(MyField) as MyField Resident 4&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;I tried without "FirstValue" thinking maybe something residuing from the 1st iteration was still here, but no: when I don't put the FirstValue, I do have all the lines of the table, still with the wrong value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is even weirdest, is that I tested to store table 4 (store table 4 into 4.'$(i)'.qvd) and then load my temp_table2 from this stored table, and I've got the exact same result (value always as if i = 1) even if in my stored table I don't have that value... the script is rightfully loading the data from&amp;nbsp;&lt;EM&gt;4.'$(i)'.qvd:&lt;/EM&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Origine &amp;lt;&amp;lt; Sheet1 21 717 Lines fetched
FINAL &amp;lt;&amp;lt; AUTOGENERATE(0) 0 Lines fetched
la valeur de i est 1
1 &amp;lt;&amp;lt; Origine 6 584 Lines fetched
2 &amp;lt;&amp;lt; 1 6 584 Lines fetched
3 &amp;lt;&amp;lt; 2 6 584 Lines fetched
4 &amp;lt;&amp;lt; 3 6 584 Lines fetched
temp_table1 &amp;lt;&amp;lt; 4 502 Lines fetched
temp_table2 &amp;lt;&amp;lt; 4.1 1 Lines fetched
...
5 &amp;lt;&amp;lt; 4 6 584 Lines fetched
FINAL &amp;lt;&amp;lt; 5 6 584 Lines fetched

la valeur de i est 2
1 &amp;lt;&amp;lt; Origine 4 931 Lines fetched
2 &amp;lt;&amp;lt; 1 4 931 Lines fetched
3 &amp;lt;&amp;lt; 2 4 931 Lines fetched
4 &amp;lt;&amp;lt; 3 4 931 Lines fetched
temp_table1 &amp;lt;&amp;lt; 4 562 Lines fetched
temp_table2-5 &amp;lt;&amp;lt; 4.2 1 Lines fetched
...
5 &amp;lt;&amp;lt; 4 4 931 Lines fetched
FINAL &amp;lt;&amp;lt; 5 11 808 Lines fetched&lt;/LI-CODE&gt;
&lt;P&gt;BUT as you might have observed, I have an indented number that appeared when i = 2 on my temp_table2 that I didn't create: temp_table2&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;-5&lt;/STRONG&gt;&lt;FONT color="#000000"&gt; and when I look at the 3rd iteration, that number changes and becomes a 6 "temp_table2-6". I don't know if this is linked, but I don't understand either why that appears.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Any ideas here on the issue are very welcome as, as you can see, only half of the work is rightfully working from table 4.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Thanks a lot everyone for your help!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 13:29:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Load-not-charging-expected-value/m-p/2138037#M26033</guid>
      <dc:creator>Delphines</dc:creator>
      <dc:date>2023-11-15T13:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Load not charging expected value</title>
      <link>https://community.qlik.com/t5/Management-Governance/Load-not-charging-expected-value/m-p/2138058#M26034</link>
      <description>&lt;P&gt;Forget about my question, I just realized I forgot to drop temp_table2 at the end of the process....&lt;span class="lia-unicode-emoji" title=":speak_no_evil_monkey:"&gt;🙊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 14:05:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Load-not-charging-expected-value/m-p/2138058#M26034</guid>
      <dc:creator>Delphines</dc:creator>
      <dc:date>2023-11-15T14:05:09Z</dc:date>
    </item>
  </channel>
</rss>

