Error while using tm1r to send dataset. How to debug this issue?

66 Views Asked by At

I am currently developing a database integrated forecasting tool for a costumer. I am using mainly R and TM1 Persepctives. To connect R with tm1 I use tm1r. For Data import from tm1 to r it works fine.

However, when I am trying to write back the calculated forecast from R to tm1, I run into problems.

I will give you some reprex data, so you can have a look at the output. If I use "tm2_send_data" instead of "tm1_send_dataset" it works fine too.

The latter function gives me the Error : "Error in if (is.character(txt) && length(txt) == 1 && nchar(txt, type = "bytes") < : missing value where TRUE/FALSE needed"

I have no clue, what this is supposed to mean! I tried some formatting of the data types, without any effect.

library(tm1r)

# data
values <- data.frame(fake_values = 
  c(105,147,159,232,312,337,285,188,257,10,98,27)
  )
date_stamps <- c("2021001","2021002","2021003","2021004","2021005","2021006","2021007","2021008","2021009","2021010","2021011","2021012")
rownames(values) = date_stamps

# Send dataset to TM1
con_obj <- tm1_connection("localhost", "8840", "test_admin", "")

tm1_send_dataset(
  con_obj,
  valueset = values, cube = "pvl_FORECAST_HILFSWÜRFEL",
  rowdim = "PVL_test_Zeit", coldim = "pvl_Produkt",
  titledim1 = "DATENART", titleel1 = "FC",
  titledim2 = "Version", titleel2 = 'Version_Bearbeitung',
  titledim3 = "FC-Scheibe", titleel3 = "ML_FC_2021",
  titledim4 = "PVL_test_Kunde", titleel4 = "MGR_domestic_D",
  titledim5 = "PVL_test_Measure", titleel5 = "Menge_EA"
)
0

There are 0 best solutions below