Skip to Content

Incorrect values with LEAD and SECONDS_BETWEEN in HANA 2.0 SP2 system

Hi,

We migrated from SP11 (1.0.112) to HANA 2.0 SP2. Post migration, query with LEAD and SECONDS_BETWEEN function is behaving weird, infact incorrectly.

In my query, I calculate LEAD value of a SECONDDATE column and then find out days between SECONDDATE column and the LEAD value. In SP11 I get a positive value, but in 2.0 system these values are negated.

Same issue happens while using SECONDS_BETWEEN in LAG function.

This is how my query looks like:

SELECT ID, DATETIME, SEQ_NUM,

LEAD(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM) AS LEAD_TIME,

SECONDS_BETWEEN(DATETIME, LEAD(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM)) AS LEAD_TIME_DIFF_SECS,

LAG(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM) AS LAG_TIME,

SECONDS_BETWEEN(DATETIME, LAG(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM)) AS LAG_TIME_DIFF_SECS

FROM TABLE;

Output from SP11 system:

Output from 2.0 SP2 system:

Has anyone faced similar issue?

Thanks,

Chandra.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 04, 2017 at 05:48 PM

    Hi All,

    This is a known issue in 2.0 SPS20 and is resolved in 2.0 SPS21. Here the is the note.

    https://launchpad.support.sap.com/#/notes/2529711

    Thanks,

    Chandra.

    Add comment
    10|10000 characters needed characters exceeded