Qlik Community

Qlik Sense Documents & Videos

Documents & videos about Qlik Sense.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today

Qlik Sense and R integration: ggplot and other visualizations, aggregation and data sorting

Specialist II
Specialist II

Qlik Sense and R integration: ggplot and other visualizations, aggregation and data sorting

 

I’ve been working with Qlik for the last four years and in the past few months I’ve been more and more involved into bringing R functionalities into my dashboards. The integration works well but there are clearly some limitations, especially when compared to other solutions on the market; Qlik in my opinion still has a significant edge in terms of performance and associative engine and, when combined with R, it brings unique functionalities and features.

The purpose of this document is to review such limitations and provide solutions with the aim of fully utilising all R capabilities in Qlik Sense; there are Qlik extensions that provide some of these features but, although very well developed and implemented, they are limited to the type of analysis they can perform; also, they require a certain level of technical skills to adapt them to the bespoke needs that very often arise when working with R.

These are the 3 topics I will cover in the document:

  • ggplot and other visualizations: how to easily and effectively display in Qlik Sense any kind of R visualization without the need to develop bespoke extensions
  • Data aggregation through concatenation: how using the aggregation function allows to pass to R more complex data frames
  • Data sorting: how data is exchanged between Qlik Sense and R and how to handle sorting

1.png

2.png

3.png

4.png

 

I hope you'll find this useful

Please let me know if you have any comment or questions

Lorenzo

 
Attachments
Comments
Creator III
Creator III

Hi Lorenz,

Thanks a lot for this document.

I am working on qliksense April 2019 patch 2 version. 

does this version supports  media box extension ?

 

Thanks in Advance!

 

Regards,

Neha

 

0 Likes
Specialist II
Specialist II

I haven't tested that version in particular but the media box extension has been around for a while. Definitely works with June and November 19 versions

0 Likes
Creator III
Creator III

Hi Lorenzo,

 

I tried in Nov 2019 version, but still I am getting error. Could you please suggest?

media ext error.jpg

 

 
 
0 Likes
Specialist II
Specialist II

Hi, I've installed it on Qlik Sense Desktop. I can see other people have had the same issues as you; one mentions that using an older version fixed the issue: https://developer.qlik.com/garden/57a0b25204177e48f38a8031

Maybe try to install a previous release? https://github.com/stefanwalther/sense-media-box/releases 

0 Likes
Specialist II
Specialist II

@neha_sri 

I've just set this up on another machine and noticed the same issue; the problem was that the zip file downloaded from the git hub project page was not the package required by Sense (it's the source files); you just need to download from the direct link; see below:

https://github.com/stefanwalther/qsMediaBox/raw/master/build/sense-media-box_latest.zip

0 Likes
Employee
Employee

@lorenzoconforti thanks for the article, as of April 2019 release the map chart can have a plain image as an background. Which means that the media box extension is no longer required.

Check out the last sheet in this app for an example:

https://community.qlik.com/t5/Qlik-Sense-Documents-Videos/Top-10-Viz-tricks-Qonnections-2019/ta-p/15...

Thanks,

Patric

0 Likes
Specialist II
Specialist II

@Patric_Nordstrom  thanks for the advice. I did have a look at it but I don't think it would work with R.

The background layer can display an image through an URL get that, looks like, is retrieved by the local client when viewing the specific page.

I need something slightly different when working with R; I need to send a script to R  with a dataframe attached (e.g. by using "R.ScriptAggrExStr" through SSE), get the response back and visualise it. In my case, to be able to show an image, the response from R (the ggplot chart) is encoded as base64 then wrapped into an html img src attribute and then displayed with the media box extension (which can parse html code). So it is not a simple URL get

I would be very happy to avoid using extensions as it adds a layer of complexities and not all clients like it so please let me know if you think there is indeed a way of achieving it through the map chart.

Thank you

Lorenzo

0 Likes
Employee
Employee

@lorenzoconforti 

Yes, it works fine with the map chart, handles data URIs well.

I put my example here, see the last page:

https://www.dropbox.com/s/ef291zscn4dwy35/R_Integration.qvf?dl=0

 

r_map.png

 

0 Likes
Specialist II
Specialist II

@Patric_Nordstrom 

Thank you very much. I'll update my documentation with this method of visualising ggplot

 

Regards

Lorenzo

Contributor
Contributor

hi Lorenzo,
thank you so much for sharing this work, it helped me a lot.

I'm a beginner in qlik, but I have been working with R for a few years and wanted to know if you indicate any material to study about this integration of R, I'm having a hard time finding materials about it.

0 Likes
Version history
Revision #:
7 of 7
Last update:
‎2019-10-29 06:02 PM
Updated by:
 
Contributors