<?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: Qlikview and R example (Predictive Demo) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660590#M1055902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton for your help. I finally figured it out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the add script and all of the tables would get reloaded with the results. I just wanted to load results on a single table box in the sheet. Then I figured that in the demo example, the results were stored under different column names (as _id, _amt, etc). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works perfectly fine, it was a silly oversight on my part. &lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Oct 2014 07:01:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-27T07:01:45Z</dc:date>
    <item>
      <title>Qlikview and R example (Predictive Demo)</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660585#M1055897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am pretty new to QlikView and have basic knowledge of R. I was trying the Predictive demo example and it worked out fine.&lt;/P&gt;&lt;P&gt;Now, I am trying to create a linear regression model in R and integrate the same with QlikView (LR model instead of a tree). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know how to display the results from R in QlikView. I am able to open the StatConnector, execute the commands in R, and store the results in a csv file. However, I do not understand how to get the results to display in QlikView. &lt;/P&gt;&lt;P&gt;Here is my macro - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Sub runRScore&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Export the selected patient data to be scored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set myTable=ActiveDocument.GetSheetObject("DataSentToR")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myTable.Export CurrentPath&amp;amp;"/ExportFile.csv",",",0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create a COM object representing R&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Set R = CreateObject("StatConnectorSrv.StatConnector")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; R.Init "R"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.EvaluateNoReturn "data &amp;lt;- read.csv('C:/Users/user/Desktop/Data.csv', na.strings=c('.', 'NA', '', '?'), strip.white=TRUE, encoding='UTF-8')"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.EvaluateNoReturn "model &amp;lt;- lm(TOT_AMT ~YEARWK + AVGRATE + CMFLAG + SEASON + ROW_NUM, data = data)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.EvaluateNoReturn "test &amp;lt;- read.csv('C:/Users/user/Desktop/ExportFile.csv') "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.EvaluateNoReturn "test$TOT_AMT &amp;lt;- NULL"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.EvaluateNoReturn "results &amp;lt;- predict(model, test)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.EvaluateNoReturn "write.csv(cbind(test,results), file = 'C:/Users/user/Desktop/Results.csv') "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Close R connection&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.close&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set v = ActiveDocument.GetVariable("vRuntime")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; v.SetContent Runtime(), True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Load the scores into the QlikView application&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.DoReload 2, false,false 'Fail on error, Partial Reload&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'WriteLog("Retrieved Scores from R at "&amp;amp;Runtime&amp;amp;".")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;End Sub&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Durga.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 07:00:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660585#M1055897</guid>
      <dc:creator />
      <dc:date>2014-10-20T07:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview and R example (Predictive Demo)</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660586#M1055898</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 have to add a load statement to your script (not to macro) which is executed during the partial reload which is triggered by your macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add load*&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&lt;C&gt; &lt;/C&gt;&lt;/P&gt;&lt;P&gt; (txt, utf8, no labels, delimiter is ';', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;depending on your file format of the R export you have to change the format options in your load.&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;Best regars&lt;/P&gt;&lt;P&gt;Stefan &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 07:19:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660586#M1055898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-20T07:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview and R example (Predictive Demo)</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660587#M1055899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in QlikView the work with data is diffenrent to other data warehouses.&lt;/P&gt;&lt;P&gt;You can load all of your data into memory.&lt;/P&gt;&lt;P&gt;By selecting values (customer name, martial no month) QlikView is filtering the results in tables and charts by himself.&lt;/P&gt;&lt;P&gt;There is no reloading from datas needed.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 07:37:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660587#M1055899</guid>
      <dc:creator>martinpohl</dc:creator>
      <dc:date>2014-10-20T07:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview and R example (Predictive Demo)</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660588#M1055900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton. However, I'm still encountering an issue. I have two tables - one showing the original data, and the other showing the predicted results (TB03 is the object ID). When I do a partial reload, the table still shows the previous values and not the predicted ones. Can you point out where I am going wrong? Or if you could point me to a useful resource, that'd be great too!&lt;/P&gt;&lt;P&gt;Thanks so much for your time.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD YEARWK, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOT_AMT, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOT_QTY, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVGRATE, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CMFLAG, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEASON, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROW_NUM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(ooxml, embedded labels, table is [BigEats-452]);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TB03:LOAD ROW_NUM, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results as TOT_AMT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Durga.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 08:37:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660588#M1055900</guid>
      <dc:creator />
      <dc:date>2014-10-20T08:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview and R example (Predictive Demo)</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660589#M1055901</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;add an 'add' statement to your load script. You also need to create another object which shows the results (add ROW_NUM and TOT_AMT to this object) and trigger the macro again:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD YEARWK, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOT_AMT, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOT_QTY, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVGRATE, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CMFLAG, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEASON, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROW_NUM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(ooxml, embedded labels, table is [BigEats-452]);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TB03:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;add&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD ROW_NUM, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results as TOT_AMT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;C&gt;&lt;/C&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Hope this helps&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Best regards&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Stefab&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 09:06:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660589#M1055901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-20T09:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview and R example (Predictive Demo)</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660590#M1055902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton for your help. I finally figured it out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the add script and all of the tables would get reloaded with the results. I just wanted to load results on a single table box in the sheet. Then I figured that in the demo example, the results were stored under different column names (as _id, _amt, etc). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works perfectly fine, it was a silly oversight on my part. &lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 07:01:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660590#M1055902</guid>
      <dc:creator />
      <dc:date>2014-10-27T07:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview and R example (Predictive Demo)</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660591#M1055903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Durga&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to share your regression QV document?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Feb 2016 12:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-and-R-example-Predictive-Demo/m-p/660591#M1055903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-14T12:52:37Z</dc:date>
    </item>
  </channel>
</rss>

