Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

R code - NORMSDIST

AdiStanescu
6 - Meteoroid

Hi,

 

 

Could you please please help me with the following situationa?

I have the following situation. I try only to apply the replace formula NORMSDIST from excel...in Alteryx.

 

I want to apply the NORMSDIST to the collumn named  "d1_1" from the data base....but I have the issues "is a nont numeric argument..." But the collumn "d1_1" containd only number...

 

Thank yo

 

 

Capture.PNG

 

 
 
9 REPLIES 9
AbhilashR
15 - Aurora
15 - Aurora

@AdiStanescu - can you use a class function inside the R tool and confirm variable1's data type?

AdiStanescu
6 - Meteoroid

 

Thank you for the answer. Yes, I can...but what is the code in R for the class function? the data type is "FixedDecimal" Please see in print screen...

 

 

AdiStanescu_0-1585510408197.png

 

AdiStanescu
6 - Meteoroid

I try also this

AdiStanescu_0-1585511016316.png

 

AbhilashR
15 - Aurora
15 - Aurora

@AdiStanescu - could you share a sample dataset from the browse tool right before the R tool from your screenshot?

AdiStanescu
6 - Meteoroid

Capture1.PNG

AdiStanescu_1-1585518957198.png

 

 

AbhilashR
15 - Aurora
15 - Aurora

Can you try using the following R code and see if it gives your the result you are looking for?

data<-read.Alteryx("#1",mode="data.frame")
variable1 <- (data$d1_1)

output<- data.frame(pnorm(variable1))

colnames(output)<-c("N1")

write.Alteryx(output,1)

 

AdiStanescu
6 - Meteoroid

yeees, it's woorks!!! thank youu very much!! how can I linked now this new column to the rest of the database?

I try with "Join" or "Union" functions...but it's not works...i quess I need a comun field

 

Thank youuu very much!!

 

AdiStanescu_0-1585528096251.png

 

AbhilashR
15 - Aurora
15 - Aurora

Try using this code on your dataset. Hopefully it works.

#read data into R tool
data<-read.Alteryx("#1",mode="data.frame")

#calculate pnorm for the column of your choice
variable1 <- data.frame(pnorm(data$d1_1))

#rename the column
colnames(variable1)<-c("N1")

#combine the new pnorm column back to original dataframe
output<- cbind(data,variable1)

#output data back into Alteryx
write.Alteryx(output,1)
AdiStanescu
6 - Meteoroid

Its works!!! Thank you very much!!! 😄

Labels