1
votes

Basically I'd like to define a scalar and then use that scalar inside of a datatable. Something like:

let dayOne = "Day One";
let dayTwo = "Day Two";
let dayStringMapping = datatable(Batch: int64, BatchDay: string)
    [   
    01, dayOne,
    02, dayTwo
    ];

How can I do this?

1

1 Answers

2
votes

The datatable operator requires constant scalar values as its input.

An alternative approach could be using the print operator.

If required, you can union several rows generated by multiple usages of the print operator.

For example:

let dayOne = "Day One";
let dayTwo = "Day Two";
let dayStringMapping = 
    union (print Batch = 1, BatchDay = dayOne),
          (print Batch = 2, BatchDay = dayTwo);
... do something with 'dayStringMapping' ...