Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

1 Reply
Brett_Bleess
Former Employee
Former Employee

Best I have is the following, it is Sense, but it might help you.  The link is from the new Data Literacy project free courses, check out the one on R integration, there may be something in that which may help you get things sorted or confirm we cannot do it, best I have:

https://qcc.qlik.com/course/view.php?id=1042

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.