
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First Sorted Value returning NULL
Hello.
With the user's help Sunny, function firstsortedvalue takes the highest value of the highest date that occurs on a table, but many times the value of the expression returns null, the model presented in the previous question I had only integer values, but I own decimals values, there is a problem in function to decimal values?
Formula:
FirstSortedValue (Value - (Date * 10000 + Value))
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be use DISTINCT?
FirstSortedValue(DISTINCT Value - (Date * 10000 + Value))
If that doesn't work, would you be able to share how your data look like (where it doesn't work)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be use DISTINCT?
FirstSortedValue(DISTINCT Value - (Date * 10000 + Value))
If that doesn't work, would you be able to share how your data look like (where it doesn't work)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One reason this isn't working could be the fact the Date is not read as Date. Make sure Date is a dual field with numeric value. Check these links:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Works!
But what's the difference using distinct in this function?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As this has decimal values, it might be finding difficult to choose between two very close values
For example: 10.99999999999 and 10.99999999998. Distinct just help the expression choose one of them randomly.
