I have a script that takes a table as an input, filters it and generates an output table.

I have a script that takes a table as an input, filters it and generates an output table.  I then want to insert a calculated column that checks for nulls and reassigns it a value.  

Here's my script: 

___________________________________________________________________

TempAm <- AM_Input

#Define the function for the conversion/update ProdmonthIs column   

ConvProdMonth <- function(ProdIS,fiscalYr,Period) 

{   if (missing(ProdIS) || is.null(ProdIS) || is.na(ProdIS))   

     { fiscalYr*100 + Period   } 

 } 

CalcProdMonth <- ConvProdMonth(ProdIS,fiscalYr,Period)

_____________________________________________________________

I have two issues with this script.  

1) When I try to set the output for the CalcProdMonth to a column in the (TempAM) table, I get an error that there are Cyclic dependencies .. How do I create and write to a new column in the same table. 

2)  When I point to create another table, I do not see the new column created ... it does not work.  Please help. 

Attachments

AttachmentSize
Image icon Terr_Input_Params.PNG25.83 KB
Image icon Terr_Inputs.PNG23.88 KB
Image icon Terr_Output.PNG19.01 KB
Image icon Terr_Output_Params.PNG17.25 KB
Image icon Terr_Script.PNG23.47 KB

(2) Answers

Login