Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.

QlikView and R Integration for Predictive Analytics Example

cancel
Showing results for 
Search instead for 
Did you mean: 
Brian_Bauer
Former Employee
Former Employee

QlikView and R Integration for Predictive Analytics Example

Last Update:

Feb 8, 2023 6:18:53 AM

Updated By:

Sonja_Bauernfeind

Created date:

Apr 2, 2013 5:16:51 PM

Attachments

If you have never thought about integrating predictive analytics and QlikView, may this article pique your interest on the topic.  If you have thought about the potential, but do not know how to get started, may this be the motivation to start your journey.

 

This demo example illustrates the art of the possible around the interoperability of the R statistics engine and QlikView 11 for enabling predictive algorithms within QlikView today.

 

R (http://www.r-project.org/) is a free software environment for statistical computing and graphics, which supports predictive modeling and scoring.  The example also introduces Rattle (Rattle: A Graphical User Interface for Data Mining using R -- http://rattle.togaware.com/).  Rattle was used to create the predictive model and generate the R code implemented within the example QlikView application.  The use of Rattle is not detailed here.  It is left up to you to explore.

 

The example assumes you understand R and how to create predictive models in R and how scoring works in R.  If you understand how to do those things in R and you know how QlikView works, this example should give you an idea of how:

  1. you could implement a compelling QlikView application for discovering trends in data as you have become used to with QlikView
  2. while adding the ability to predict outcomes using a proven, trained scoring model you have built in R
  3. and while showing actionable predicted outcomes at the point of decision

-- all without the end user having to leave QlikView.

 

As in the previous example posted by Elif Tutuk, "Integrating QV with R example kit.zip" (http://community.qlik.com/docs/DOC-2975), the example utilizes statconnDCOM.  A slightly different approach in this example overcomes a break in functionality introduced into that earlier example by the changing in the behavior of one of the COM API methods in the most recent releases of statconnDCOM.

 

The integration is done using QlikView's built-in VBScript support to interoperate with the DCOM-based API.  This is just one way to integrate with R.  With a little research you can discover other potential opportunities for R integration (e.g., OpenCPU).  Also, note that R is just one such example of a statistical engine being integrated with QlikView.  Other solutions, such as commercially available statistical engines or predictive scoring engines may also be integrated in similar ways.

 

To get started with this example, save the attached file, QlikView-R_Predictive_Demo.zip, to your system.  Open the zip file, and copy the enclosed folder (QlikView-R_Predictive_Demo) to a location of your choice.  The location is not important as the example is portable and has no dependency on being placed in a particular folder on your system. Now navigate into the folder you just extracted and find the document named “Qlikview-R Integration Demo 20170310.pdf”.  Open the document and follow the instructions step-by-step.

 

UPDATE (May 7, 2014):  I updated the installation document (Qlikview-R Integration Demo 20140421.pdf) to eliminate the RAndFriends installer as it has been unavailable for some time.  This edition of the document references R 3.1.0.  Hopefully the instructions will continue to be a good guide for subsequent versions as well.  I will continue to monitor for changes in R, statconnDCOM and other R components which could effect how the demo application works going forward.  The example QlikView application itself remains unchanged. It is a Personal Edition version, so you should be able to explore it with a licensed QlikView Desktop or the Personal Edition.  Thank you for your continued feedback on this demo.

 

UPDATE (September 21, 2015):  Everyone who has been seeing the message "The license that is embedded in this document is not valid":  I attached an updated version of QlikView-R_Predictive_Demo.zip‌.  Ensure you overwrite the old QVW with the new one in this package.  That is the only change.  Please forgive this looooong overdue update. 

 

UPDATE (October 9, 2016):  Updated the embedded license to work with QlikView Desktop Personal Edition.

 

UPDATE (February 2, 2017):  Updated the embedded license to work with QlikView Desktop Personal Edition.

 

UPDATE (March 10. 2017):  A dependency for this particular example is statconnDCOM from the team at autstat (http://www.autstat.com/).  If you wish to utilize statconnDCOM, you will need to contact autstat directly and purchase a license or request an evaluation license for testing.

 

 

Labels (1)
Comments
Not applicable

Hi All,

The connection Statconn worked perfectly well during the last month but since the 30th december 2015 the Statconnector Test does'nt work anymore:

Capture.PNG


Do you have ways to explain that or solve the issue?

I use R.3.1.0 and the statconnDCOM.latest.

Regards,

Thanks in advance.

Yohan

Not applicable

The connector still does its work, even if it shows that error msg.

Plz try using the integration!

-HTH

Swapneel

sujeetsingh
Master III
Master III

Brian I am having issue with connection it says activx cant create object  for 64 bit machine although I followed all the steps provided by you.

??

Not applicable

I'm trying but it still doesn't work..

The macro stops at the instruction : R.INIT "R"

Is it possible to have an issue with the Statconn license? Is it limited in time?

Thanks for your help

Anonymous
Not applicable

I had the same problem.

I found that there is a new version of connector - statconnDCOM3.6-0B3_Noncommercial, i installed it and everything works fine again.

Michal

sujeetsingh
Master III
Master III

Brian,

I was trying to make your sample more optimized. Hence if we think of calculation of cofficient  for lacks of records then exporting to csv can be time consuming. I tried two changes in your sample

1. In spite of saving the selected fields to csv i tried clipboard  and added this code

ActiveDocument.GetSheetObject("DataSentToR").CopyTableToClipboard true

R.EvaluateNoReturn "crs$dataset <- read.tabel('clipboard')

I refer the sample from Integrating QV with R example kit.zip. Here clipboard is used.

I did the changes but the macro do not execute. Can you please cross check.

2. Store the Output to SQl table

For this I loaded RODBC library and used below code

     R.EvaluateNoReturn "library(RODBC)"

     R.EvaluateNoReturn "conection1<- odbcConnect('MyDSN')"

     R.EvaluateNoReturn "sqlSave(conection1,correlation,tablename = ExportFile_score_idents)"


Even this code do not execute successfully.


PLEASE HAVE A LOOK !!

THANKS

Not applicable

Hello

i saw the example and it worked for me but i have not understood how to change the data source for adapting it to my needs .

i used rattle library on R and i saw the script generated i think i had to past it in the macro on qlik but it's not really clear.

Aymen


Not applicable

Even after downloading the new .zip package and using R 3.2.3 im having the license issue: "The license that is embedded in this document is not valid". I tried using both versions of the connector statconnDCOM.latest and statconnDCOM3.6-0B3_Noncommercial. Does the .zip need to be updated again?

Btw, im using Personal Edition.

Not applicable

I followed the document in the zip file to the letter and got to the last stage of the installation process but the date in the decision tree is not getting updated. What could I have done wrong? Please help.

Not applicable

Hi, i was able to follow all the steps and have the demo working - half way...

It runs fine, and updates the charts, half the time, another half (when I select just a few patient IDs)

it runs the statcon, then the qlikview hangs with Macro Running...

The same happens when I adopt the demo for my files and R script, the statcon runs, R script runs and creates all the export.csv files, but qlikview keeps hanging...

Any ideas?

Thank you very much for the example and all the help!

Norayr

Version history
Last update:
‎2023-02-08 06:18 AM
Updated by: