4 Replies Latest reply on Apr 26, 2018 8:29 AM by Shinichiro Murakami

# Complex Calculation with difference data type

Hello thogether,

I have a Problem with a Calculation

The case is example:

01.03.2018 19:50:00 + (-1) - (01.03.2018 00:00:00 +09:30:00)

Data Typ + Attribute type - (Date type + Date type)

The result shout be: 18:50 - 09:30 o'clock is 09:20 hours

The second problem is in the field with the 08:00:00 hour hear is only the time and no date.

Is this calculation possible?

Thanks

• ###### 1. Re: Complex Calculation with difference data type

HI Lea

Time is difficult to handle because it is different from the application.

Even my example, I am not sure the data is exactly same as yours.

% is modulo which give you the float value less than one.

1 = 1 day in tableau.

And unfortunately Tableau does not have "Time", but only have datetime.

So, you need to change the date format to hh:mm

Thanks,

Shin

• ###### 2. Re: Complex Calculation with difference data type

Hi Lea Zimmer ,

Yes you can get these kind of calculation done ,but you will have to create different complex functions using tableau function .

These are date -time functions available in tableau .

The case is example:

01.03.2018 19:50:00 + (-1) - (01.03.2018 00:00:00 +09:30:00)

Data Typ + Attribute type - (Date type + Date type)

The result shout be: 18:50 - 09:30 o'clock is 09:20 hours

What is Attribute type here ??

DATEDIFF('second',#2004-07-15 00:59:00#,#2004-07-15 00:58:00#,'sunday')

DATEADD('second',60,#2004-04-15 13:00:00#)    along with different functions.

Or you can also attach a twbx file here and explain your requirements .

-Nikher Verma

• ###### 3. Re: Complex Calculation with difference data type

Hi Shinichiro Murakami ,

I guess tableau date function can deal with time also .I tried doing so and i am getting the desired result .

-Nikher Verma

• ###### 4. Re: Complex Calculation with difference data type

This is what I mean by "time" which excel has as it's feature

Tableau only have datetime.

Thanks,

Shin