Skip to main content

#Append0 debatiendo

Hello,

 

I'm trying to do some forecasting that goes beyond Tableau's built in forecasting capabilities but running into some problems. When I apply this formula (bold is the important part):

 

SCRIPT_STR("library(forecast);

predict_data <- .arg1;

log_ts <- ts(log(predict_data),frequency=52);

diff_ts=diff(log_ts); ⌗make data stationary

length=length(diff_ts)-1;

predict_data2=diff_ts[1:length]; ⌗ignore latest y count

regressors=data.frame(summer=.arg2[2:(length+1)],fall=.arg3[2:(length+1)], winter=.arg4[2:(length+1)], nwd=.arg5[2:(length+1)]); # get explanatory variable data

xreg=cbind(summer=model.matrix(~as.factor(regressors$summer)),fall=regressors$fall, winter=regressors$winter, nwd=regressors$nwd); ⌗make matrix of explanatory variables

xreg=xreg[,-1]; ⌗exclude intercept

modArima=auto.arima(predict_data2,xreg=xreg); ⌗dynamic regression model

 

season=strsplit(.arg6, ",")[[1]]; ⌗create vector of dummy variables from [Season] string season.num=as.numeric(season); ⌗convery dummy variables to numeric x=append(season.num, min(.arg7); ⌗append dummy variables with [# of NWD] for prediction vector

 

mat=matrix(x,nrow=1); ⌗xreg requires matrix

fcast=forecast(modArima,xreg=mat,h=1);

paste(predict_data[(length-1)]exp(fcast$lower)[1,1],predict_data[(length-1)]exp(fcast$upper)[1,1],sep='~') ⌗transform back and grab 80 PI", sum([y]),sum([Summer]),sum([Fall]),sum([Winter]),sum([NWD]),[Season],[# of NWD])

 

I get this error:

Error in base::parse(text = .cmd) : <text>:12:0:unexpected end of input

10: modArima=auto.arima(predict_data2,xreg=xreg); ⌗dynamic regression model

11: season=strsplit(.arg6,

^

 

[Season] is a string parameter that can take on the value of "0,0,0" "0,1,0" "1,0,0" or "0,0,1". What is weird to me is that when I try out the bolded part of the script in R, I have no issues at all.

 

Anyone know what could be causing the problem in Tableau? Thanks!

 

Sorry I can not post a workbook as the data is private.

3 respuestas
0/9000

Hi Everyone,

 

I am looking for some guidance on the following scenario using Data Prep within Tableau CRM:

 

Object A: Val1

Object B: Rec1 Rec2 Rec3

 

Expected Dataset output 

Val1Rec1

Val1Rec2

Val1Rec3

 

Please note there are no common keys between the 2 objects. 

 

We tried the following: Utilized Data Prep by creating 2 new fields with same "Field name" in Object A like Object B and use APPEND function and Map Object A and Object B to the 2 new field names. 

 

The output results:

Dataset output

"Null"Rec1

"Null"Rec2

"Null"Rec3

Val1"Null"

Val1"Null"

 

Which does not meet the Expected Dataset output

 

Thank you in advance

 

Andrew

0/9000

Hello team! Data transformation question! :)

 

I would like to create a field that appends data from 3 other fields in my dataset, the union statement almost works 100% but I lost faceting when a interact using the new field created.

 

I would like to know if it's possible to create an appended field in dataflow referencing the same dataset. 

 

Thank you so much!

2 comentarios
0/9000

Hi all,

I use a recipe based on a trended report to create a dataset (A).

I would to append data to the recipe A but the recipe fails; this is the error message:

"Something went wrong while executing the Append_Table_Compute_1 node: metadata fields failed schema-validation: invalid field-name, '$SystemSnapshotStamp' (02K1v000000dKi1EAE_03C1v000002PouvEAC)".

 

What am I doing wrong?

 

tks

2 comentarios
  1. 3 sept 2019, 07:26

    Hi Shantanu,

    the name is the same; '$SystemSnapshotStamp' is a system name and is automatically generated by SF when a report is trended.

0/9000

Hi all,

 

We are pulling data from different sources from within BigQuery then Appending them together with Recipes because of the easy column mapping UI. Due to them not sharing column naming what would be the best way to map the columns easily before or during the Append process within a Dataflow

 

Any suggestions welcome.

8 comentarios
0/9000