Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
Highlighted
juliogiulio
New Contributor

Qlikview script: manipulate table data as whole columns

Hi everybody,

I am learning how to use Advanced Analytics functions within the Qlikview script, but I am stuck at a point where I think I am missing some basic Qlikview concept.

THis is what I am doing in the script:

IrisLoad:

LOAD observation,

     [sepal length] as sepLen,

     [sepal width] as sepWid,

     [petal length] as petLen,

     [petal width] as petWid,

     [iris species]

FROM

Data\Iris.csv

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

SSELoad:

Load

R.ScriptEval('print(cbind(q$petLen, q$petWid, q$sepLen, q$sepWid))', petLen,   petWid,   sepLen,   sepWid) as ClusterSpecies             

Resident IrisLoad;

In SSELoad, the fields petLen, petWid, sepLen, sepWid are sent to R one line at a time. I can see it from the R consolle, which is executing the print statement 150 times (the size of IrisLoad). How can I send this data (petLen, petWid, sepLen, sepWid ) to R as whole columns? So that petLen will be an array of 150 elements, and so on for the other fields? I want R to receive the data only once, executing the print statement of a table with 4 coumns and 150 records. Is this possible? Shall I use some type of aggregate function?

Thanks!

JG