making the duration more dynamic

I saw in a post in this community that the duration type data written in the formula must be enclosed in double quotation marks. what if I want the duration to be more dynamic/use another lookup table? I've tried using the /, &, data type. The "Duration (hours)" column is already in duration, but it still doesn't work.
Deadline column that doesn't work should be:
[Date] + LOOKUP([Type], "PRICE", "Type", "Duration (hours)")
The lookup results always read 1 day/24 hours, even though in the table it is not 24 hours.
Non dynamic formula that works:
[Date] + "036:00:00"
When tested it was noted that the duration of the file was converted correctly to 1 day 12 hours, and the "Date" was added successfully.

0 2 113
2 REPLIES 2

Please post such questions in the 'Q&A" section.

Maybe you wish to try

[Date] + LOOKUP([_THISROW].[Type], "PRICE", "Type", "Duration (hours)")

If this does not work, you may need to share more details about where you are using this expression , relevant tables and column details etc.

Aurelien
Google Developer Expert
Google Developer Expert

Hi @FelyTomboy 

You may want to move your post to Q&A instead of Tips & Tricks, which is for sharing tips.

About your question: I think the expression may not be grabbing the "original type" of [Duration (hours)] due to the LOOKUP expression.

 

You may want to use a reference to get the duration type more easily.

Aurelien_0-1717052364459.png

and use this expression instead:

Aurelien_1-1717052437014.png

[date]+[Type].[Duration (hours)]

Note: I just tested it, works like a charm.

Aurelien_2-1717052501334.png

For reference:

Dereference expressions - AppSheet Help