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
gshockxcc
Creator
Creator

Hi Brian,

     Excellent post, and thanks for putting this together.  I am getting the following error when trying to run the StatConnector Test on R32.

R_Install_StatConn_Error.png

R_Install_StatConn_Test.png

I've read through the remainder of the posts, and I don't see any resolution to this type of error.  I made sure that rattle was installed, and I copied the files to C:\Program Files\R\R-3.1.3

Unfortunately, that didn't seem to have an effect.

It appears that the rest of the installation worked fine.  However, the Date Timestamp doesn't update when I click on the Decision Tree.

Thanks in advance for your help.

Regards,

-Kristan

Not applicable

Hi Kristan,

Kindly uninstall the current version of statconn.

Download the statconn 3.6 OB2 Noncommercial version from the statconn site, and install the same.

You issue will be solved.

Regards

Swapneel

gshockxcc
Creator
Creator

Hi Swapneel.  That is the version that I have installed.

statconnDCOM.png

Thanks for your help.    

Not applicable

You are welcome

So is it working now ?

Regards

Swapneel

gshockxcc
Creator
Creator

No, I had downloaded that version when I tried the first time.  I uninstalled and re-installed just now, and still the same error on the StatConnector Test.

Not applicable

Uninstall the statconn, Restart your machine, and install statconn, restart the machine.

This worked for me, as previously we were using the A version and this was the B version of statconn.

Do give it a try till the time, some expert answers this...

Regards

Swapneel

Not applicable

Hi Kristan,

I was having the same issue and I got the StatConnector working by overriding the C:\Program Files

(x86)\statconn\DCOM\Testing.lic withe one provided with statconn 3.6 OB2 Noncommercial.

Best regards,

Daniel

Not applicable

Hi Everyone,

I'm stock with rattle.

When I execute rattle(), the Rattle windows is launching after five warnings like this:

rattle error.png

Did anyone have this issue?

I'm guessing this is why the qlikview app is launching the "Edit Module" window when I click the "Run Risk Assessment" button.

Thanks in advance,

Daniel

Not applicable

Hi Everyone,

I was debugging the VBScript Macro and it stops at:

     R.EvaluateNoReturn "crs$rpart <- rpart(death ~ ., data=crs$dataset[, c(crs$input, crs$target)], method='class', parms=list(split='information'), control=rpart.control(usesurrogate=0, maxsurrogate=0))"

When I execute the macro using Excel VBA it throws this error in that line:

vba error.png

----------

I'm able to run the code in the R Console and generate the image, but it stops at that line in the macro(in Excel and Qlikview).

Thanks in advance,

Daniel

Not applicable

Hi Brian,

I was able to install everything. But when I run the macro, it stops at :

     R.EvaluateNoReturn "crs$rpart <- rpart(death ~ ., data=crs$dataset[, c(crs$input, crs$target)], method='class', parms=list(split='information'), control=rpart.control(usesurrogate=0, maxsurrogate=0))"

I was also testing in excel macro:

Public Sub ExecFile()

Set R = CreateObject("StatConnectorSrv.StatConnector")

R.Init "R"

R.EvaluateNoReturn "library(rattle)"

R.EvaluateNoReturn "library(colorspace)"

R.EvaluateNoReturn "library(rpart)"

  R.Close

End Sub


and it fails at : R.EvaluateNoReturn "library(rpart)"


I'm able to generate the image if I execute the code in the  R Console.


I'm using:

statcon  3.6-0B2

R 3.1.3 64 bits

Win 7 64 bits

Qlikview 11.2 SR9 64 bits.



Thanks in advance,

Daniel

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