qlik sense FirstSortedValue cannot display issue

Backgroud

we got the issue on FirstSortedValue , FirstSortedValue(Onborded_Date, Onborded_Date) AS Customer_First_Onborded_Date , it will display -(null) if met duplicate records. eg some records are have the same Onborded_Date.

about how to use the FirstSortedValue ,can goto the official help document: AggregationFunctions FirstSortedValue

  • FirstSortedValue(Onborded_Date, Onborded_Date), will show the first/oldest value ,but will be null if met duplicate records.
  • FirstSortedValue(Onborded_Date, -Onborded_Date), will show the last/newest value ,but will be null if met duplicate records.

Solution

So based on the FirstSortedValue function , we should add a Distinct to select value with duplicate records.

  • FirstSortedValue(Distinct Onborded_Date, Onborded_Date), will show the first/oldest value , can distinct from duplicate records.
  • FirstSortedValue(Distinct Onborded_Date, -Onborded_Date), will show the last/newest value, can distinct from duplicate records.
LOAD
FirstSortedValue(Distinct Customer_Onborded_Date, Customer_Onborded_Date) AS Customer_First_Onborded_Date,
FirstSortedValue(Distinct Customer_Onborded_Date, -Customer_Onborded_Date) AS Customer_Last_Onborded_Date,

你可能感兴趣的:(Qlik,Sense)