<?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 Using Alias in Subsequent Calculations in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204214#M61215</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks spastor, very good solution.&lt;/P&gt;&lt;P&gt;I have another problem like this with the join. I write below an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myFinalTable:&lt;/P&gt;&lt;P&gt;Load *, left(myAlias,1) as mySecondAlias, left(yourAlias,1) as yourSecondAlias;&lt;/P&gt;&lt;P&gt;Load myColumn as ID, left(myColumn,2) as myAlias&lt;/P&gt;&lt;P&gt;resident myTable;&lt;/P&gt;&lt;P&gt;left join&lt;/P&gt;&lt;P&gt;Load yourColumn as ID, left(yourColumn,2) as yourAlias&lt;/P&gt;&lt;P&gt;resident yourTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error: "yourAlias" not found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;spastor wrote:&lt;BR /&gt;An easoest way in order to avoid temporary table:&lt;BR /&gt;&lt;BR /&gt;myFinalTable:&lt;BR /&gt;Load *, left(myAlias,1) as mySecondAlias;&lt;BR /&gt;Load myColumn, left(myColumn,2) as myAlias&lt;BR /&gt;resident myTable;&lt;BR /&gt;This way it will generate only one table with the data you need !&lt;BR /&gt;More complicated to read but easier to generate...&lt;BR /&gt;Rgds,&lt;BR /&gt;Sébastien&lt;BR /&gt; &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Dec 2010 17:35:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-12-28T17:35:56Z</dc:date>
    <item>
      <title>Using Alias in Subsequent Calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204209#M61210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am relatively new to Qlikview and am trying to master the Scripting language.&lt;/P&gt;&lt;P&gt;I have an estimate that is built up in a transactional table over time. The estimate amounts are contained in a single field [TransAmt].&lt;/P&gt;&lt;P&gt;I would like to parse out the data into multiple fields, depending upon the value of the [Cost Column] field. I have managed to do this satisfactorily with the attached if/then/else constructs.&lt;/P&gt;&lt;P&gt;However, I would then like to perform calcultions on the parsed fields to create yet further fields. eg. (Actual_T + Accrual_T) as Incurred_T, also as shown below.&lt;/P&gt;&lt;P&gt;However, when I add that line, I get an error on reloading the script "Field not found - &amp;lt;Actual_T&amp;gt;".&lt;/P&gt;&lt;P&gt;I tried adding a new load statement / table etc., but kept getting the same error.&lt;/P&gt;&lt;P&gt;Is there anyway around this? It seems that expression can only rely on the results of explicit fields, and not on the results of other expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;load&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[CompileID]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;[MonthID]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;([Cost Column]='budget', TransAmt,0) &lt;B&gt;as&lt;/B&gt; Budget_T,&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;([Cost Column] = 'Commitment', TransAmt,0) &lt;B&gt;as&lt;/B&gt; Commitment_T,&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(([Cost Column]) = 'Actual',TransAmt,0) &lt;B&gt;as&lt;/B&gt; Actual_T,&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;([Cost Column] = 'Accrual',TransAmt,0) &lt;B&gt;as&lt;/B&gt; Accrual_T,&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;([Cost Column] = 'ETC',TransAmt,0) &lt;B&gt;as&lt;/B&gt; [ETC_T],&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Actual_T + Accrual_T) &lt;B&gt;as&lt;/B&gt; Incurred_T&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;Resident&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;EstimateItems_T; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 08:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204209#M61210</guid>
      <dc:creator />
      <dc:date>2010-06-28T08:54:20Z</dc:date>
    </item>
    <item>
      <title>Using Alias in Subsequent Calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204210#M61211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know, there's no way to use load-based aliases in the load block that generated them. However, you can use them in subsequent loads, e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;myLoad:&lt;BR /&gt;Load myColumn, left(myColumn,2) as myAlias&lt;BR /&gt;resident myTable;&lt;BR /&gt;&lt;BR /&gt;Load *, left(myAlias,1) as mySecondAlias&lt;BR /&gt;Resident myLoad;&lt;BR /&gt;&lt;BR /&gt;drop table myLoad;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;There's similar ways to achieve the same thing without loading a temporary table and dropping it (by using LEFT JOIN on a unique key, for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jun 2010 09:23:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204210#M61211</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2010-06-28T09:23:38Z</dc:date>
    </item>
    <item>
      <title>Using Alias in Subsequent Calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204211#M61212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Or,&lt;/P&gt;&lt;P&gt;That worked well - saved me a lot of experrimentation.&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 02:39:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204211#M61212</guid>
      <dc:creator />
      <dc:date>2010-06-29T02:39:49Z</dc:date>
    </item>
    <item>
      <title>Using Alias in Subsequent Calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204212#M61213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Or Shoham,&lt;/P&gt;&lt;P&gt;how can I use LEFT JOIN to achieve the same result?&lt;/P&gt;&lt;P&gt;I'm trying without success....&lt;/P&gt;&lt;P&gt;Thank you a lot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Or Shoham wrote:&lt;BR /&gt;As far as I know, there's no way to use load-based aliases in the load block that generated them. However, you can use them in subsequent loads, e.g.&lt;BR /&gt; &amp;lt;blockquote&amp;gt;&lt;BR /&gt;&lt;BR /&gt;myLoad:&lt;BR /&gt;Load myColumn, left(myColumn,2) as myAlias&lt;BR /&gt;resident myTable;&lt;BR /&gt;&lt;BR /&gt;Load *, left(myAlias,1) as mySecondAlias&lt;BR /&gt;Resident myLoad;&lt;BR /&gt;&lt;BR /&gt;drop table myLoad;&amp;lt;pre&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's similar ways to achieve the same thing without loading a temporary table and dropping it (by using LEFT JOIN on a unique key, for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;DIV style="CLEAR:both;"&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Dec 2010 16:18:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204212#M61213</guid>
      <dc:creator />
      <dc:date>2010-12-28T16:18:02Z</dc:date>
    </item>
    <item>
      <title>Using Alias in Subsequent Calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204213#M61214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An easoest way in order to avoid temporary table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myFinalTable:&lt;/P&gt;&lt;P&gt;Load *, left(myAlias,1) as mySecondAlias;&lt;/P&gt;&lt;P&gt;Load myColumn, left(myColumn,2) as myAlias&lt;/P&gt;&lt;P&gt;resident myTable;&lt;/P&gt;&lt;P&gt;This way it will generate only one table with the data you need !&lt;/P&gt;&lt;P&gt;More complicated to read but easier to generate...&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sébastien&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Dec 2010 16:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204213#M61214</guid>
      <dc:creator />
      <dc:date>2010-12-28T16:27:06Z</dc:date>
    </item>
    <item>
      <title>Using Alias in Subsequent Calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204214#M61215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks spastor, very good solution.&lt;/P&gt;&lt;P&gt;I have another problem like this with the join. I write below an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myFinalTable:&lt;/P&gt;&lt;P&gt;Load *, left(myAlias,1) as mySecondAlias, left(yourAlias,1) as yourSecondAlias;&lt;/P&gt;&lt;P&gt;Load myColumn as ID, left(myColumn,2) as myAlias&lt;/P&gt;&lt;P&gt;resident myTable;&lt;/P&gt;&lt;P&gt;left join&lt;/P&gt;&lt;P&gt;Load yourColumn as ID, left(yourColumn,2) as yourAlias&lt;/P&gt;&lt;P&gt;resident yourTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error: "yourAlias" not found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;spastor wrote:&lt;BR /&gt;An easoest way in order to avoid temporary table:&lt;BR /&gt;&lt;BR /&gt;myFinalTable:&lt;BR /&gt;Load *, left(myAlias,1) as mySecondAlias;&lt;BR /&gt;Load myColumn, left(myColumn,2) as myAlias&lt;BR /&gt;resident myTable;&lt;BR /&gt;This way it will generate only one table with the data you need !&lt;BR /&gt;More complicated to read but easier to generate...&lt;BR /&gt;Rgds,&lt;BR /&gt;Sébastien&lt;BR /&gt; &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Dec 2010 17:35:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Alias-in-Subsequent-Calculations/m-p/204214#M61215</guid>
      <dc:creator />
      <dc:date>2010-12-28T17:35:56Z</dc:date>
    </item>
  </channel>
</rss>

