cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering by maximum date in HANA Graphical Calculation View

Former Member
0 Kudos

Hello,

Please help me with some advice.

This is my scenario. I have a table with the next relevant fields:

| GUID | NodeID | RegisterDate | ProcessingDate | value1 | value2 |
-------------------------------------------------------------------
|   1  |    1   |  2017.01.01  |   2017.01.09   |   10   |  20    |   
|   2  |    1   |  2017.01.02  |   2017.01.09   |   10   |  30    |  
|   3  |    2   |  2017.01.02  |   2017.01.10   |   10   |  40    |   
|   4  |    2   |  2017.01.02  |   2017.01.11   |   10   |  40    | 
...  

What I need is something like this:

select * from...
        where ProcessingDate = 'inputParameter(date)'                             and max(RegisterDate)
     group by NodeID

and the expected result should be:

| GUID | NodeID | RegisterDate | ProcessingDate | value1 | value2 |
------------------------------------------------------------------- 
|   2  |    1   |  2017.01.02  |   2017.01.09   |   10   |  30    |  
|   4  |    2   |  2017.01.02  |   2017.01.11   |   10   |  40    | 

So, is there a possibility to achieve this scenario using Agregation/Projection nodes in graphical calculation view or the best solution is SQL Script?

I found a solution using Rank Node, but the performance is slow.

Thanks for your attention.

lbreddemann
Active Contributor
0 Kudos

Your requirement is not quite clear.

Do you want the entries that have the maximum RegisterDate per ProcessingDate or per what other grouping? Also, do you only want the very first or all that have that maximum RegisterDate?

As for the performance issue: "performance is slow" is not providing any insight to help to improve the situation. As a developer, you should be able to provide more detailed information about where the time is spent and what part of the query processing is "slow" and what "slow" actually means.

Accepted Solutions (0)

Answers (0)