Qlik Community

Qlik Server Side Extensions Discussions

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

Partner
Partner

Load R dataframe into Qliksense

Hi All,

I have a requirement to load dataframe created in R into qliksense , attached is the details. can someone help me with the syntax to load the dataframe into qliksense.Thank you

Dataframe.png

12 Replies
tomlcart
New Contributor III

Re: Load R dataframe into Qliksense

Partner
Partner

Re: Load R dataframe into Qliksense

Hi Carter,

Thanks for the response,in April 2018 qliksense, we can load the data from R to Qliksense without writing macros,

i would like to get help on syntax if you have idea.

Highlighted
asiic999
New Contributor II

Re: Load R dataframe into Qliksense

Hello, I'm just in the process, with the integration you mention (AAI), the first thing I'll do is investigate what the default functions of the connector do:

R.ScriptEvalStr

R.ScriptEvalExStr

R.ScriptEvalEx

R.ScriptEval

R.ScriptAggrStr

R.ScriptAggrExStr

R.ScriptAggrEx

R.ScriptAggr

ost
New Contributor III

Re: Load R dataframe into Qliksense

Hi chaitanya‌!

Based on your post I'm not sure on how familiar you are with SSE (Server Side Extensions). Have you taken a look at the R-plugin (https://github.com/qlik-oss/sse-r-plugin)? There is a Get Started guide in the repo explaining how to configure the plugin and run the examples provided. If you're not familiar with SSE I recommend you to first take a look at our main repository (https://github.com/qlik-oss/server-side-extension) before looking into the R-plugin example, which explains the protocol and its functionality as well as provides examples in different languages.

Kind regards,

Josefine

Partner
Partner

Re: Load R dataframe into Qliksense

Hi Josefine,

Thank you,i have installed SSER Plugin in qliksense setup, dont know how start extacting this data frame into qliksense. i just need to bring data in to sense, thats it

vasil_gutev
New Contributor

Re: Load R dataframe into Qliksense

Hi ,

try this way:

emp_data:

Load*

Extension R.ScriptEval('emp.data;');

Partner
Partner

Re: Load R dataframe into Qliksense

Hi Vasil,

iam getting below error, do you have any idea what could be done. all the services are up and running.

error.png

vasil_gutev
New Contributor

Re: Load R dataframe into Qliksense

Hi Chaitanya,

please check all of the columns data types and convert them to string, because some R data types aren't supported in Qlik. Later in Qlik Sense you can convert them again to "Date" and "Num".

Partner
Partner

Re: Load R dataframe into Qliksense

Hello,

I don't think you can load directly a data frame from R to Qlik Sense, maybe you should try to export your data in csv.

Please find how I load data frame with the Iris data:

First I am importing the CSV file

[Iris]:

LOAD

   *

FROM [lib://Data/Iris.csv]

(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

Then I load this table in an other table to create cluester

[Cluster]:

Load *

Extension

R.ScriptEval('

          X <- cbind(q$sL,q$sl,q$pL,q$pl)

          Cluster = kmeans(X, centers = 3, nstart=20)$cluster

          data.frame(Id = q$Id, Cluster);

',Iris{Id,sL,sl,pL,pl});

Hope it'll help

Regards