Qlik Community

Qlik Server Side Extensions Discussions

Discussion Board for collaboration on Server-Side Extensions and Advanced Analytics Integration.

amit_shetty78
Contributor II

Is it possible to return dataframe from R and show in a QS table?

Hi,

Is it possible to return a data frame from R and show the data in a Qliksense table?

Say I have some dimension list that I select and that gets passed into R and then R returns a dataframe that I show in a table.

Appreciate any help on this.

Thanks.

7 Replies
jamajka1
Contributor

Re: Is it possible to return dataframe from R and show in a QS table?

Could you post here an example?

Ralf_Heukäufer
Contributor III

Re: Is it possible to return dataframe from R and show in a QS table?

Hello,

you can use this at first

Installing R with Qlik Sense.pdf

After the Installation you can use:

1. The Advanced Analytics Toolbox

Qlik Branch

GitHub - mhamano/advanced-analytics-toolbox: Qlik Sense extension which allows you to create charts ...

Under the Point Installation (in GitHub) you find the required R Packages you need to install for this Extension

2.  The Advanced Analytics Expression Builder

Qlik Branch

If you only want to use Expressions in the Qlik Sense Visualizations.

akarolewski
New Contributor III

Re: Is it possible to return dataframe from R and show in a QS table?

My solution is:

  • sent a vector or few vectors from Qlik
  • put them together in R script as a data frame
  • do the analytics
  • get a single column/vector from that dataframe in R as a output
  • show it in a calculation field as a single column
  • repeat it as many times as many columns from R (based on the input data) you need in Qlik - so every measure in Qlik is single column from output data frame from R
amit_shetty78
Contributor II

Re: Is it possible to return dataframe from R and show in a QS table?

Thanks hf-group‌.

akarolewski

Could you share an example of your solution please?

Thanks.

amit_shetty78
Contributor II

Re: Is it possible to return dataframe from R and show in a QS table?

Hi jamajka1‌, akarolewski‌, hf-group

Just to illustrate what I am trying to do in R I am running the following:

load("Data/Weighted_Values.RData");

ts <- data.frame(TS)

The output of 'ts' can be viewed in the following image:

Capture.PNG

I would like to show this result in a time series line chart in Qlik Sense.

I have the Date as dimension in my QS data model. I would like to map the date to the corresponding values returned.

Thanks.

Employee
Employee

Re: Is it possible to return dataframe from R and show in a QS table?

In the Qlik Sense February 2018 release, support have been added for returning a whole table (dataframe) from the plugin to Qlik in a single request, when called from the Qlik Sense load script. This means that you can add a dataframe from R as a table in the Qlik data model during data reload.

So stay tuned for the Feb 2018 release where more information will come regarding this.

amit_shetty78
Contributor II

Re: Is it possible to return dataframe from R and show in a QS table?

Thanks tln‌. Look forward to the Feb 2018 release to make use of this feature.

I have been able to get the values from the dataframe to load into my chart at runtime using an expressions such as below:

R.ScriptEvalEx( 'S', 'load(paste("\\\\servename\\Data\\",q$DatasetName[1],".RData",sep="")); TS;'    , DatasetName As DatasetName)

Community Browser