<?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 Reusing Variables created using As during LOAD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reusing-Variables-created-using-As-during-LOAD/m-p/1424639#M612342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code works, but there has to be a better way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Status='No Impact', If(Date#([Completion Date])&amp;gt;=1,[Completion Date],[Received Date]),[Completion Date]) as [POP: Completion Date],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is using the [Received Date] if the [Completion Date] is missing, but only if the [Status] is "No Impact". So far, there is no problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question #1: Why can't I leave the [Completion Date] as the name of the variable? As you notice, I created a new variable with as [POP: Completion Date]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next I use the newly created variable in a calculation as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(If(Status='No Impact', If(Date#([Completion Date])&amp;gt;=1,[Completion Date],[Received Date]),[Completion Date])&amp;gt;0,If(Status='No Impact', If(Date#([Completion Date])&amp;gt;=1,[Completion Date],[Received Date]),[Completion Date])-[Received Date],Today()-[Received Date]) as [POP: Days Open],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could not use the newly created variable [POP: Completion Date], so I had to cut and paste the entire if statement to accomplish this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question #2: Can you reuse the newly created variable in an expression in the same LOAD statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to some great insights.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Oct 2017 16:32:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-24T16:32:50Z</dc:date>
    <item>
      <title>Reusing Variables created using As during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Reusing-Variables-created-using-As-during-LOAD/m-p/1424639#M612342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code works, but there has to be a better way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Status='No Impact', If(Date#([Completion Date])&amp;gt;=1,[Completion Date],[Received Date]),[Completion Date]) as [POP: Completion Date],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is using the [Received Date] if the [Completion Date] is missing, but only if the [Status] is "No Impact". So far, there is no problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question #1: Why can't I leave the [Completion Date] as the name of the variable? As you notice, I created a new variable with as [POP: Completion Date]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next I use the newly created variable in a calculation as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(If(Status='No Impact', If(Date#([Completion Date])&amp;gt;=1,[Completion Date],[Received Date]),[Completion Date])&amp;gt;0,If(Status='No Impact', If(Date#([Completion Date])&amp;gt;=1,[Completion Date],[Received Date]),[Completion Date])-[Received Date],Today()-[Received Date]) as [POP: Days Open],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could not use the newly created variable [POP: Completion Date], so I had to cut and paste the entire if statement to accomplish this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question #2: Can you reuse the newly created variable in an expression in the same LOAD statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to some great insights.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 16:32:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusing-Variables-created-using-As-during-LOAD/m-p/1424639#M612342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-24T16:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reusing Variables created using As during LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Reusing-Variables-created-using-As-during-LOAD/m-p/1424640#M612343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohammed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Question #1: Maybe you have an '*' in the LOAD, or another field that loads with the field (variable) name [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Completion Date], and the names should be unique, if there is a field already named [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Completion Date] you need to change the name.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Question #2: there is a 'precending load', wich uses a LOAD as a source for another load, this way you can use calculated fields created in the previous step:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LOAD *&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;[POP: Completion Date]&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;gt;0,&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[POP: Completion Date]&lt;/SPAN&gt;-[Received Date],Today()-[Received Date]) as [POP: Days Open]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LOAD *,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If(Status='No Impact', If(Date#([Completion Date])&amp;gt;=1,[Completion Date],[Received Date]),[Completion Date]) as &lt;STRONG&gt;[POP: Completion Date]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 17:38:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusing-Variables-created-using-As-during-LOAD/m-p/1424640#M612343</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2017-10-24T17:38:27Z</dc:date>
    </item>
  </channel>
</rss>

