Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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))

1 Solution

Accepted Solutions
sunny_talwar

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)

View solution in original post

4 Replies
sunny_talwar

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)

sunny_talwar

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:

Dates in Set Analysis

Why don’t my dates work?

Not applicable
Author

Works!

But what's the difference using distinct in this function?

sunny_talwar

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.