<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: R.ScriptEval(): passing data with QlikView in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7886#M14124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;size &lt;/P&gt;&lt;P&gt;is setting the bubble size you can actually use a third expression for this &lt;/P&gt;&lt;P&gt;or a static number like i did so all symbols have the same size&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Feb 2018 14:12:48 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2018-02-01T14:12:48Z</dc:date>
    <item>
      <title>R.ScriptEval(): passing data with QlikView</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7883#M14121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qlik aficionados,&lt;/P&gt;&lt;P&gt;I am currently trying to implement the Iris Cluster example in Qlikview.&lt;/P&gt;&lt;P&gt;Basically, it consists of an input dataset with the following fields: &lt;EM&gt;Observation, Sepal Length, Sepal Width, Petal Length, Petal Width, Iris Species&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;I need to call the R function kmeans in order to group irises into 3 clusters, based on the information about petal and sepal dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a table chart, using &lt;EM&gt;Observation&lt;/EM&gt; as dimension, and&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;R.ScriptEval('kmeans(cbind(q$petLen, q$petWid, q$sepLen, q$sepWid), 3, nstart = 20)$cluster', petLen, petWid, sepLen, sepWid)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;as the expression. This works wonderfully!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I want to create a scatter chart, assigning a color to each observation, according to the cluster it belongs to.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So, I set &lt;EM&gt;Observation&lt;/EM&gt; as dimension, &lt;EM&gt;Petal Length&lt;/EM&gt; as first expression (x-axis) and &lt;EM&gt;Petal Width&lt;/EM&gt; as second expression (y-axes). Then, on the x-axis background properties, I set the following rule: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;if (R.ScriptEval('kmeans(cbind(q$petLen, q$petWid,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;q$sepLen, q$sepWid),3, nstart = 20)$cluster', petLen, petWid, sepLen, sepWid)=1, rgb(200, 12, 45))&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;For simplicity, here I avoided nested IFs. For the moment, the idea is to set the color for the &lt;EM&gt;Observations&lt;/EM&gt; belonging to cluster 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing this, I get the error message "Allocated memory exceeded" on the scatter plot, while SSEtoRserve says "more cluster centers than distinct data points".&lt;/P&gt;&lt;P&gt;My explanation of this is that Qlikview is passing the data to R one record at a time. Therefore, R can't calculate 3 clusters out of a single line of data. This is also confirmed by the fact that if I set the clusters variable to 1, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I think that the correct question is: How can I pass my variables to R as a whole? I mean, just like passing the entire variable array, and not the points one by one.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;And also, why is the same function working correctly with the table chart? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the length of the post, but I hope this is clear. I am rather new with Qlikview, and I am aware that it is very likely that &lt;SPAN style="font-size: 10pt;"&gt;I am missing some importan and basic detail about the way Qlikview uses data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Nov 2024 08:48:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7883#M14121</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T08:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: R.ScriptEval(): passing data with QlikView</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7884#M14122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;attach is a sample with a work around for your problem&lt;/P&gt;&lt;P&gt;i encountered the same issue , will test it later&lt;/P&gt;&lt;P&gt;by the way why do you use qlikview and not qlik sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 08:17:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7884#M14122</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2018-02-01T08:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: R.ScriptEval(): passing data with QlikView</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7885#M14123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Liron!&lt;/P&gt;&lt;P&gt;This is exactly what I was looking for!! However, I guess I have to learn more about scatter plots now.. I don't understand what the expression "size" is doing. If I change the number in its definition, I can see the colors on the plot changing position between clusters, while if I remove it, the dot sizes of the clusters are affected. Also, this expression looks different from the others, as its display options are different, though not changeable.&lt;/P&gt;&lt;P&gt;Regarding your question, I am doing this exercise because I want to implement cluster analysis in a pre existent Qlikview project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 13:57:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7885#M14123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-01T13:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: R.ScriptEval(): passing data with QlikView</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7886#M14124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;size &lt;/P&gt;&lt;P&gt;is setting the bubble size you can actually use a third expression for this &lt;/P&gt;&lt;P&gt;or a static number like i did so all symbols have the same size&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 14:12:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/R-ScriptEval-passing-data-with-QlikView/m-p/7886#M14124</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2018-02-01T14:12:48Z</dc:date>
    </item>
  </channel>
</rss>

