<?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 Use of values from database in the loading script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-of-values-from-database-in-the-loading-script/m-p/1457783#M795390</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello and happy New Year! &lt;BR /&gt;My current loading script uses some hard-coded date values to calculate some extra fields. My client added an extra table in his database to have the said date values be more dynamically modified, without having to modify the whole QlikView loading script. Now my issue is, how can I extract the values from the said table and use them in the loading script? &lt;BR /&gt;For the record the hard-coded date values look kind of like this: &lt;/P&gt;&lt;P&gt;LET Cycle1_start = MakeDate(2017,01,10);&lt;/P&gt;&lt;P&gt;Cycle1_stop = MakeDate(2017,04,28);&lt;/P&gt;&lt;P&gt;Cycle2_start = MakeDate(2017,05,02);&lt;/P&gt;&lt;P&gt;Cycle2_stop=MakeDate(2017,09,11);&lt;/P&gt;&lt;P&gt;Cycle3_start=MakeDate(2017,09,12);&lt;/P&gt;&lt;P&gt;Cycle3_stop=MakeDate(2018,01,08);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "Cycle" table has the following structure:&lt;/P&gt;&lt;P&gt;`id` bigint(20) NOT NULL AUTO_INCREMENT,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `version` bigint(20) NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `date_end` datetime NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `date_start` datetime NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `deleted` bit(1) NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `name` varchar(255) NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PRIMARY KEY (`id`)&lt;/P&gt;&lt;P&gt; ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Use of values from database in the loading script</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-values-from-database-in-the-loading-script/m-p/1457783#M795390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello and happy New Year! &lt;BR /&gt;My current loading script uses some hard-coded date values to calculate some extra fields. My client added an extra table in his database to have the said date values be more dynamically modified, without having to modify the whole QlikView loading script. Now my issue is, how can I extract the values from the said table and use them in the loading script? &lt;BR /&gt;For the record the hard-coded date values look kind of like this: &lt;/P&gt;&lt;P&gt;LET Cycle1_start = MakeDate(2017,01,10);&lt;/P&gt;&lt;P&gt;Cycle1_stop = MakeDate(2017,04,28);&lt;/P&gt;&lt;P&gt;Cycle2_start = MakeDate(2017,05,02);&lt;/P&gt;&lt;P&gt;Cycle2_stop=MakeDate(2017,09,11);&lt;/P&gt;&lt;P&gt;Cycle3_start=MakeDate(2017,09,12);&lt;/P&gt;&lt;P&gt;Cycle3_stop=MakeDate(2018,01,08);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "Cycle" table has the following structure:&lt;/P&gt;&lt;P&gt;`id` bigint(20) NOT NULL AUTO_INCREMENT,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `version` bigint(20) NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `date_end` datetime NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `date_start` datetime NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `deleted` bit(1) NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; `name` varchar(255) NOT NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp; PRIMARY KEY (`id`)&lt;/P&gt;&lt;P&gt; ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-values-from-database-in-the-loading-script/m-p/1457783#M795390</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use of values from database in the loading script</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-values-from-database-in-the-loading-script/m-p/1457784#M795392</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;if you already know how to SQL load your database table, just add this after it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;let v&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Date_end&lt;/SPAN&gt; = peek ( '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_end&lt;/SPAN&gt;', 0 , ' the_name_of_your_loaded_table ');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;you will have your Date end value stored into the variable and you can use it wherever you want on the script&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jan 2018 08:39:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-values-from-database-in-the-loading-script/m-p/1457784#M795392</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-01-03T08:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Use of values from database in the loading script</title>
      <link>https://community.qlik.com/t5/QlikView/Use-of-values-from-database-in-the-loading-script/m-p/1457785#M795393</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 use the peek function to find the records and fields you need. The below is just an example that assumes the first 3 records have the corresponding cycles...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Cycle:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Load&amp;nbsp; *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;from cycle&lt;/P&gt;&lt;P&gt;where etc...&lt;/P&gt;&lt;P&gt;order by ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let Cycle1_start = Date(Peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_start&lt;/SPAN&gt;', 0, 'Cycle')); &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let Cycle1_stop = Date(Peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_stop&lt;/SPAN&gt;', 0, 'Cycle')); &lt;/P&gt;&lt;P&gt;Let Cycle2_start = Date(Peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_start&lt;/SPAN&gt;', 1, 'Cycle')); &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let Cycle2_stop = Date(Peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_stop&lt;/SPAN&gt;', 1, 'Cycle')); &lt;/P&gt;&lt;P&gt;Let Cycle3_start = Date(Peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_start&lt;/SPAN&gt;', 2, 'Cycle')); &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Let Cycle3_stop = Date(Peek('date_stop', 2, 'Cycle')); &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757; font-family: arial, helvetica, sans-serif;"&gt;Drop Table Cycle;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757; font-family: arial, helvetica, sans-serif;"&gt;I hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757; font-family: arial, helvetica, sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757; font-family: arial, helvetica, sans-serif;"&gt;Luis&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jan 2018 08:52:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-of-values-from-database-in-the-loading-script/m-p/1457785#M795393</guid>
      <dc:creator>luismadriz</dc:creator>
      <dc:date>2018-01-03T08:52:10Z</dc:date>
    </item>
  </channel>
</rss>

