Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lead function

oracle Lead function is not working in the Edit Script section. I am using Qlikview 9.00 SRS 6.0 version. Please suggest any body has tried this.

20 Replies
rbecher
MVP
MVP

It works fine. I tried on v9 SR6 via ODBC. Maybe your SELECT is wrong or it's an OLE problem.

Could you post a script excerpt?

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Hi Ralf,

I am using the below Query. Please correct me if i am wrong

SQL SELECT
"ID",
(TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24))))) As SDATETIME,
Lead((TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24)))))) OVER (ORDER BY (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24)))))) as Newdate
FROM TABLEA
WHERE ID=1 AND SUS =5 AND (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((MDATE)/(60*60*24)))))>=(TO_DATE('01/01/2011 00:00:00','MM/DD/YYYY HH24:MI:SS'));

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

QlikView works like this:

Load Fieldname, ..,
Function(fieldname) As fieldname2;
SQL Select *
from Table
Where ...;

that means you have to enter the function into the Load-statement not into the SQL Select!

rbecher
MVP
MVP

Martina,

LEAD is an Oracle function...

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Hi Ralf,

Can u please help me on this.

rbecher
MVP
MVP

Sure, I would do it in a different way, inside out:

LEAD(SDATE) OVER(ORDER BY SDATE)


..and make the calculation outside.

- Ralf

Astrato.io Head of R&D
rbecher
MVP
MVP

Btw, the LEAD part of your statement is working on my site in QV 9.

So, did you try the query against the database?

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Hi Ralf,

I have used the way you had given in the previous Query.It is just the conversion within the date. I am getting missing parenthesis error. I am also using the Qlikview 9.00 SRS 6.00 version. Can u post the complete sql statement of my Sql Query.

Thanks for your response.

Not applicable
Author

Yes i did except lead function the Query is running Fine without error. Is there any equivalent function for lead in Qlikview