<?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: Adding a new column with Field value from same table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adding-a-new-column-with-Field-value-from-same-table/m-p/1592707#M596861</link>
    <description>&lt;P&gt;There might be a more efficient method of doing it but this should get you what you're looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Directory;
LOAD
Country,
CURRENCY,
CODE,
USDperCURR,
CURRperUSD
FROM 201906_MOR.xls (biff, embedded labels, table is Summary$, filters( .......));

EURperUSD:
load
CURRperUSD as EURperUSD
Resident Directory
where CODE='EUR';

LET vEURperUSD = peek('EURperUSD',0,'EURperUSD');

NoConcatenate
Directory2:
load
*,
$(vEURperUSD) as EURperUSD
resident Directory;

drop tables Directory, EURperUSD;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 16:31:57 GMT</pubDate>
    <dc:creator>awaisqureshi</dc:creator>
    <dc:date>2019-06-17T16:31:57Z</dc:date>
    <item>
      <title>Adding a new column with Field value from same table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-new-column-with-Field-value-from-same-table/m-p/1592667#M596860</link>
      <description>&lt;P&gt;I would need to add one extra column to my table of X-rates, simply using one of the values in the table (EUR per USD xrate) and populate this value across all rows in my table. I thought it would be easy , but I can´t find the way to do it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated. Here is the piece of code I am struggling with&amp;nbsp;&lt;/P&gt;&lt;P&gt;Directory;&lt;BR /&gt;LOAD&lt;BR /&gt;Country,&lt;BR /&gt;CURRENCY,&lt;BR /&gt;CODE,&lt;BR /&gt;USDperCURR,&lt;BR /&gt;CURRperUSD,&lt;BR /&gt;if(CODE='EUR',CURRperUSD) as EURperUSD&lt;BR /&gt;FROM 201906_MOR.xls (biff, embedded labels, table is Summary$, filters( .......));&lt;/P&gt;&lt;P&gt;I simply need the last calculated field to populate for all rows ...not only for the row where CODE=EUR ( like in attached printscreen ).&lt;/P&gt;&lt;P&gt;Thank you !!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:39:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-new-column-with-Field-value-from-same-table/m-p/1592667#M596860</guid>
      <dc:creator>quiquehm</dc:creator>
      <dc:date>2024-11-16T20:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a new column with Field value from same table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-new-column-with-Field-value-from-same-table/m-p/1592707#M596861</link>
      <description>&lt;P&gt;There might be a more efficient method of doing it but this should get you what you're looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Directory;
LOAD
Country,
CURRENCY,
CODE,
USDperCURR,
CURRperUSD
FROM 201906_MOR.xls (biff, embedded labels, table is Summary$, filters( .......));

EURperUSD:
load
CURRperUSD as EURperUSD
Resident Directory
where CODE='EUR';

LET vEURperUSD = peek('EURperUSD',0,'EURperUSD');

NoConcatenate
Directory2:
load
*,
$(vEURperUSD) as EURperUSD
resident Directory;

drop tables Directory, EURperUSD;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 16:31:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-new-column-with-Field-value-from-same-table/m-p/1592707#M596861</guid>
      <dc:creator>awaisqureshi</dc:creator>
      <dc:date>2019-06-17T16:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a new column with Field value from same table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-new-column-with-Field-value-from-same-table/m-p/1593108#M596862</link>
      <description>&lt;P&gt;Thanks a lot ! I just tried your script and of course it works.&lt;/P&gt;&lt;P&gt;Only one comment is, and sorry if it caused confusion , that the name of the table is not "Directory", this is just a Qlikview statement that defines the directory where the files being loaded are located .&amp;nbsp; In my case I think there is no need to add a path to the directory statement, as I am using relative paths in the data load&amp;nbsp; ( I am not even sure if Directory is needed at all in my case ...I will try without it ).&lt;/P&gt;&lt;P&gt;As you also mentioned, I am curious to see if there could be an easier/faster method to do this ( without using a variable and the peek function ) ....any other ideas out there ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 13:41:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-new-column-with-Field-value-from-same-table/m-p/1593108#M596862</guid>
      <dc:creator>quiquehm</dc:creator>
      <dc:date>2019-06-18T13:41:01Z</dc:date>
    </item>
  </channel>
</rss>

