0 Replies Latest reply: Jan 28, 2018 1:35 PM by giulio cecco RSS

    Qlikview script: manipulate table data as whole columns

    giulio cecco

      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:



      LOAD observation,

           [sepal length] as sepLen,

           [sepal width] as sepWid,

           [petal length] as petLen,

           [petal width] as petWid,

           [iris species]



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





      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?