on 2025 Jan 24 3:50 AM
Hello,
I am trying to use the Lead window function in a SQL view to return the Date value of the next record and it coming up blank. The last record in the partition is showing Null - which is as expected. I am not sure why the dates for the previous records are not populating. Similar SQL query in HANA works fine. The issue exists just in Datasphere SQL viewer ( and Graphical view)
Here's my SQL
SELECT "Customer_ID","Lead_Date",
lead("Lead_Date") OVER (PARTITION BY "Customer_ID" ORDER BY "Lead_Date") AS "Next Lead Date"
FROM "LEAD_TEST"And this is the result that I get. "Next Lead Date" should be output of the Lead window function - Basically next record's "Lead_Date" for the customer Id.
Any thoughts on what I am missing?
Thank you,
Hiri
Request clarification before answering.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.