Switch function calculated field

I have a calculated field “Column Group” that I use with a parameter, so according to the option selected it will change the column of a table accordingly

switch(${prmColumnGroup}, 
    'Day', Day, 
    'Weekday', Weekday, 
    Day
)

For the ‘Day’ Field I am basically extracting the date from another field

extract('DD', {Activity Start})

However, I got a request to have the ‘Day’ concatenated with Day of the week name, for example “11 T” Where the ‘T’ is the first letter of the day

But when trying to include that field on the switch for “Column Group” calculated field, I get syntax error, so not sure if it needs an specific format.

The new field for “DayName” is something like

concat(
    toString(Day),
    " ",
    {Day_Abrv}
)

Where “Day_Abrv” is

substring({day_of_week_name}, 1, 1)

So far I tried to use toString() to see if makes any difference but issue remains.

Any guidance is appreciated

Hi @HUIL,

Your Day and Weekday fields (I’m assuming you’re also using the extract function to get Weekday) both return an integer but DayName is a string. Your switch function can’t return different data types. If you use DayName instead of Day in your switch function, you need to change Weekday to toString(Weekday).