How to stop keep formatting using prepare / formula recipe

abalo006 Registered Posts: 29

I have string value called hours, formatted as "00" and a value called minutes formatted as "07".

Im trying to use the concat function to create an HH:mm value = 00:07 but for some reason when using concat, it gets rid of trailing 0s and results in 0:7. is there a way around this?

if not is there any other way I can create my HH:mm value using my hours and minutes values?

Operating system used: windows

Best Answer

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,718 Neuron
    edited July 17 Answer ✓

    This formula can add leading zeros as required:

    concat(("00" + Hours).substring(-2), ":", ("00" + Minutes).substring(-2))

    Screenshot 2024-05-31 at 19.22.06.png


Setup Info
      Help me…