Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Linus42
Contributor II
Contributor II

How to choose first/smallest value

Hi!

Each of the customers have 2 dates, Edate and Odate. I now want to find and use the smallest date as a new value in my dashboard.

Example

Customer Edate Odate Newdate
Adam 23 Oct 2022 18 May 2022 18 May 2022
Alvin 18 May 2021 8 Aug 2022 18 May 2021
Casper 13 Dec 2019 1 Oct 2022 13 Dec 2019

 

What is the most effective way of  doing this?

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Use the RangeMin() function , example 

RangeMin(Edate,Odate) as NewDate

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

5 Replies
BrunPierre
Partner - Master
Partner - Master

In the script as below

If(Edate<Odate,Edate,If(Odate<Edate,Edate)) as Newdate

Linus42
Contributor II
Contributor II
Author

Thank you! That seems to work for when all the date values are there. However there are some dates that are empty. Any tips on how to make a rule that fixes the issue with non existing dates? 

BrunPierre
Partner - Master
Partner - Master

What do you want to do when dates are null, share some data on such instances and what you expect as output.

Linus42
Contributor II
Contributor II
Author

If dates are missing, I still want the first/earliest date in my new date field. Something like this:

 

Customer Edate Odate Newdate
Adam 23 Oct 2022 18 May 2022 18 May 2022
Alvin 18 May 2021 8 Aug 2022 18 May 2021
Casper 13 Dec 2019 1 Oct 2022 13 Dec 2019
Maya   5 Aug 2022 5 Aug 2022
Peter 1 Dec 2021   1 Dec 2021
vinieme12
Champion III
Champion III

Use the RangeMin() function , example 

RangeMin(Edate,Odate) as NewDate

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.