Introduction of DURATION() expression

We have expression to fix the data type to time by using TIME() expression. When we write the complex expression, we can convert and fix the data type inside the expression by using TIME expression to direct the AppSheet the returned value is actually TIME data type.

For instance,

TIME( xx &":"& yy &":"&zz)

xx &":"& yy &":"&zz   is actualy text, but by wrapping by TIME expression, they are deemed as TIME type inside the expression which could be bit deeply nested.  However, when we have text expression which yield like xxxxxx &":"& yy &":"&zz

We have no way to instruct the AppSheet this is DURATION value, as we are missing the data type convertion expression to text to duration.

Once we could have DURATION(argument), it is make our life easier as we do not need to separate the expression into the multiple columns.

DURATION() expression is just prepared to convert the text type to duration type inside expression parser. Thank you.

 

@Steve 

Status Open
5 3 193
3 Comments
SkrOYC
Gold 5
Gold 5

What does the expression assistant thinks when you have a text field like this?:


@Koichi_Tsuji wrote:

However, when we have text expression which yield like xxxxxx &":"& yy &":"&zz


What I mean is that the expression should parse a text value like "XXXXX:YY:ZZ" as duration by default. If it doesn't, I'd consider this a bug.

Just asking btw, I know you should have a good reason to ask for DURATION() and even if it's possible to do something like this today, DURATION() sounds like a convenient new expression

Koichi_Tsuji
Gold 4
Gold 4

@SkrOYC wrote:

What I mean is that the expression should parse a text value like "XXXXX:YY:ZZ" as duration by default.


Inside the expression assitant (expression parcer) this is recognized as a text insted of duration, which lead me to throw this feature request.  I dont think this is a bug.

 

2CT-Christian
Bronze 2
Bronze 2

I think this DURATION expression should also be configurable for date durations: days,  weeks, months,  years, etc.