Forum Discussion

Applicable88's avatar
Applicable88
Impactful Individual
4 years ago
Solved

Variant Datatype calculated column with String and Date

Hello,

I have a joined table , where orders got a finish time and a fetch time. When an order is ready, but nobody fetch it yet, intead of fetch datetime I want a string returning "not fetched yet".

But since its a mixture of Date and string datatype I get the variant datatype error message. 

Basically like this:

OrdernumberFinishtime Fetchtime
1234 01.01.2021 not fetched yet
1235 02.01.2021 03.01.2021
1236 03.01.2021 03.01.2021
1237 07.01.2021 09.01.2021
1238 08.01.2021 not fetched yet
1239 09.01.2021 not fetched yet

 

I tried with formatting the date time into a string, but it showed weird numbers, since it is in the standard 

date format like DD.MM.YYYY anymore. 

 

Thank you very much in advance.

Best. 

 

 

2 Replies

  • Applicable88 , You need a text column like

     

    if(isblank([Fetchtime]) , format([FetchDate], "DD.MM.YYYY") , "not fetched yet")

  • Hi Applicable88 ,

    Assuming your Fetchtime and Finishtime columns are of date datatype, You might have to create a new column as below

    new_fetch = IF(ISBLANK(order_finish_fetch[Fetchtime]), "Not Fetched Yet", FORMAT(order_finish_fetch[Fetchtime],"dd.mm.yyyy"))

    Screenshot below with both fetchtime and new_fetch (as per your need)