Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
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

Anonymous
Not applicable
Author

Adam, the changes you suggested worked fine.

thanks a lot

Rodolfo Souza