Qlik Community

Ask a Question

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
rodolfoag
Contributor III
Contributor III

R.scriptaggrstr return wrong numbers

Hi  Qlik  experts,

I'm trying to use R.Scriptaggrstr function to get a concatenations of strings based on numbers which are returns of some R expression.

Each result is fine when it is brought by R.scriptaggr, but when I use R.Scriptaggrstr('paste(exp1,exp2....)') the results of the expressions are wrong. Any idieas of this issue?

thanks in advance

Rodolfo Souza

Labels (2)
1 Solution

Accepted Solutions
akarolewski
Contributor III
Contributor III

Maybe try R.ScriptAggrExStr and as you pass numbers specify R.ScriptAggrExStr('NN', 'paste(q$exp1,q$exp2....)' ,exp1 as exp1, exp2 as exp2). You indiciate that you take numbers but you want text output.

Also please be more specific - what do you mean "wrong numbers"? What is returned - error or wrong numbers? Qlik can pass data in different order than you assume - it passes in "table" order.

View solution in original post

3 Replies
akarolewski
Contributor III
Contributor III

Maybe try R.ScriptAggrExStr and as you pass numbers specify R.ScriptAggrExStr('NN', 'paste(q$exp1,q$exp2....)' ,exp1 as exp1, exp2 as exp2). You indiciate that you take numbers but you want text output.

Also please be more specific - what do you mean "wrong numbers"? What is returned - error or wrong numbers? Qlik can pass data in different order than you assume - it passes in "table" order.

View solution in original post

rodolfoag
Contributor III
Contributor III
Author

Hi Adam, thanks for your answer, I was attempting to make a text based on two number, for example:

num1 is the result of R.scriptaggr, this step works fine

num2 is the result of R.scriptaggr, this step works fine and works fine too.

When I try R.scriptaggr('paste("some text ",num1Rexpression," some text ",num2Rexpression," some text")', parameters).

the result of this is:    some text num3 some text num4 some text

the characters are OK, but num3 was not the expected num1, either for num2.


On summary: the result of the numeric portion of the result string are not the same as the isolate R.scriptaggr functions



Rodolfo Souza

rodolfoag
Contributor III
Contributor III
Author

Adam, the changes you suggested worked fine.

thanks a lot

Rodolfo Souza