cancel
Showing results for 
Search instead for 
Did you mean: 

Combining columns

danielrabinovit
7 - Data Storage

Hi,

This is probably a really easy fix but I have columns in my table called 

Shift Date, Shift Start time

I want to combine these as a custom column and then convert to a date time, but for the life of me I cannot get it to work. They are both text at the moment (sisense wont let me put them in as datetime at the start).
I am using excel sheet for now and here is an example snippet of the data:

I have tried using 
SELECT
[Shift Date],
[Shift Start Time],
[Shift Date] || ' - ' || [Shift Start Time] AS combined_column
FROM
Sheet1; 

but I get : Line 4 Column 19
Found '|' but '<Expression>' expected.

 

Shift DateShift Typeshift start time
4/10/2025Primary08:00:00
4/12/2025Primary08:00:00
4/11/2025Primary08:00:00
1 REPLY 1

HamzaJ
12 - Data Integration

Hey @danielrabinovit ,

|| is not a valid sisense sql expression. To concatenate you can use either concat() or +. In your example it would be something like

concat(concat([Shift Date],' - ' ),[Shift Start Time]) AS combined_column

This combines those 2 fields. However it does not create a regular datetime-field. To do so you need to use todatetime() to convert it so that Sisense will recognize it as a datetime-field and you can use it as such in a dashboard. Otherwise it treat it as a text-field. More on how to convert can be found below:

https://docs.sisense.com/main/SisenseLinux/date-and-time-functions.htm

Hamza

Type a product name