<?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: Load Script Formatting and calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482913#M1123660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;start as [start date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end as [end date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[end date]-[start date] as duration &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from source;&lt;/EM&gt;&lt;BR /&gt;the above script will result in error, as Qlikview doesnot know [start date] and [end date]{alias names} until the execution of the load statement is complete&lt;/P&gt;&lt;P&gt;.So try using the bewlow statement,&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;start as [start date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end as [end date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end -start&amp;nbsp; as duration&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from source;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is where you are loosing it...&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;If you want to make some sort of calculations then use resident to achive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Sundar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jan 2014 15:51:27 GMT</pubDate>
    <dc:creator>sundarakumar</dc:creator>
    <dc:date>2014-01-08T15:51:27Z</dc:date>
    <item>
      <title>Load Script Formatting and calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482910#M1123657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i Have some data from excel that im trying to put into QlikView. The format isnt really changeable(currently general) as its imported data. i was under the impression that qlikview would recognise this as a date/time and would allow me to use as such e.g finish-start=Duration and so on.&lt;/P&gt;&lt;P&gt;Ive tried in the load script with no avail. any ideas?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Timestamp#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Start_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YY hh:mm:ss') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;T&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;imestamp#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Finish_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YY hh:mm:ss') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Finish Date] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="196"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="19" width="98"&gt;Start_Date&lt;/TD&gt;&lt;TD width="98"&gt;Finish_Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;01/08/13 09:00&lt;/TD&gt;&lt;TD&gt;03/03/14 17:30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;01/08/13 09:00&lt;/TD&gt;&lt;TD&gt;02/08/13 08:30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 14:46:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482910#M1123657</guid>
      <dc:creator>samuel_brierley</dc:creator>
      <dc:date>2014-01-08T14:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Formatting and calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482911#M1123658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't actually have seconds on your timestamps (from what you've posted anyway), so maybe try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Timestamp#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Start_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YY hh:mm') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;T&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;imestamp#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Finish_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YY hh:mm') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Finish Date] &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 14:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482911#M1123658</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-01-08T14:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Formatting and calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482912#M1123659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could read the data like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Results_from_Excel:&lt;/P&gt;&lt;P&gt;LOAD Start_Date, Finish_Date FROM &lt;C&gt; (biff, embedded labels, table is Blad1$);&lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so without any conversion, and for the calculation (in a expression)&amp;nbsp; you could use the interval-command like : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Interval( Date(Finish_Date) - Date( Start_Date), 'dd hh:mm:ss'&amp;nbsp; ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 15:38:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482912#M1123659</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-08T15:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Formatting and calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482913#M1123660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Samuel,&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;start as [start date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end as [end date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[end date]-[start date] as duration &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from source;&lt;/EM&gt;&lt;BR /&gt;the above script will result in error, as Qlikview doesnot know [start date] and [end date]{alias names} until the execution of the load statement is complete&lt;/P&gt;&lt;P&gt;.So try using the bewlow statement,&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;start as [start date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end as [end date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end -start&amp;nbsp; as duration&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from source;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is where you are loosing it...&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;If you want to make some sort of calculations then use resident to achive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Sundar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 15:51:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482913#M1123660</guid>
      <dc:creator>sundarakumar</dc:creator>
      <dc:date>2014-01-08T15:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Formatting and calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482914#M1123661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to do some calculation and then use the filed to calculate another calculated field you could use resident load as below,&lt;/P&gt;&lt;P&gt;first:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;id,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;exp(start) as [start date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;exp(end) as [end date]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from source;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Second:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;id,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[start date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[end date],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;[end date]-[start date] as duration&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resident first;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;drop table first;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Sundar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Formatting-and-calculation/m-p/482914#M1123661</guid>
      <dc:creator>sundarakumar</dc:creator>
      <dc:date>2014-01-08T16:01:13Z</dc:date>
    </item>
  </channel>
</rss>

