cancel
Showing results for 
Search instead for 
Did you mean: 

HANA modeling - filter on last date

ssurampally
Active Contributor
0 Kudos

Hi,  I have got modeling requirement to filter out the last value based on certain column combination, the output of my caclulation view is as below,

EmployeeGroupCreated onExpense
100021Corporate10 - Sep - 201520000 $
100021Corporate09 - Oct - 201515000 $
100021Travel06 - Jul - 201518000 $
100021Corporate05 - Aug - 201619000 $
100021Travel10 - Sep - 201624000 $

when I am modeling this data to next level in HANA studio, I would need to all only the latest records available on the combination of Employee, Group and date. In the above table, only the ones highlighted in red are required for reporting.  so for every combination of Employee and group, I will need to identify the last date record and allow that only further.

I am thinking is there any way, to achieve this requirement in graphical calculation view,  if not going to scripted calculation view is an option. But at this moment, I am waiting for other options.  if you have come across this requirement, please let me know.

Thanks

Sreekanth

Accepted Solutions (1)

Accepted Solutions (1)

former_member200930
Participant
0 Kudos

Hi Sreekanth,

I would suggest try to use RANK Functionality. Please check below example.

I have created similar table in my system.

I have done simple modeling using RANK node.

RANK NODE setting ;

Final Output :

- Vikram Divekar

ssurampally
Active Contributor
0 Kudos

It looks like, promising. I will apply this login on my model, I will let you know the result, Thank you so much for your assistance Vikram.

ssurampally
Active Contributor
0 Kudos

Thank you, It worked fine Vikram. if you have some time, I have got another requirement on this data model, however it is for another report, I will build a new model with out Rank node logic.  To explain the logic better, just changed the numbers in the expense column.

RecordEmployeeGroupCreated onExpense
1100021Corporate10 - Sep - 201520000 $
2100021Corporate09 - Oct - 201515000 $
3100021Travel06 - Jul - 201520000 $
4100021Corporate05 - Aug - 201625000 $
5100021Travel10 - Sep - 201624000 $

Unlike the previous requirement, where only last value has to be shown, here all of the records to be shown however a new filter will be applied.

user would like to review the employee who had a change in the expense of initial date and last date by group, in the above example record 1 is the initial record and record 4 is the last the increase is 5000,  user can input the variable, "Expense increment" = 5000, all the employee who met this condition along with group are to be shown in the report.

In the above example, the data should be, records 1, 2 and 4 displayed.  but not 3 and 5, because in the travel, employee had a increase of expense +4000, it did not met the filter criteria.

I am thinking a by creating a new calculated column and store the difference of 1st and last date records value for every combination of Employee and Group,  but not sure how do I achieve that.

Please let me know, it is possible by graphical nodes?

Answers (0)