Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting the max date infro from the table

Hi guys!

Need your help!

I have an Excel table like this:

I need to find the max date of each person and get the Account name.

Please help!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Still not very clear, so I have to make assumptions that could be right or wrong:


1. Month field format is DD.MM.YYYY, that is 01.02.14 is February 2014.
2. You want to find the largest value per person, and then the last date when it value occurs.  And, you want this in the script, not the front end.
3. Find the Account of the record identified in #2.  (I'm confused about this because in your example Account to Person is one-to-one relation, there is nothing much to find.)

Anyway, if my assumptions are correct, see the attached app.  Either it helps you to go forward, or you'll clarify further what you need.

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Let's try...

Data:

LOAD

     Employee,

     date(max(StartDate)) as MaxDate

FROM <YourExcelFile>

GROUP BY Employee;

LEFT JOIN (Data) LOAD

LOAD

     Employee,

     Account

FROM <YourExcelFile>;

Not applicable
Author

Hi, Michael.

I think I havent written all the requirements above. The thing is that I also need to take into consideration other columns like : January, February etc. Need to find the latest month of the latest Account where the value is not null. Also there can be 2 accounts at the same period I need to find the account with the biggest value.

Anonymous
Not applicable
Author

I don't understand

Try to explain with an example.

Not applicable
Author

I've made a crosstable out of this. Here I have a new table:

EmployeeAccountMonthData
Pavel KovalskiInternational Other01.01.14
Pavel KovalskiInternational Other01.01.150
Pavel KovalskiInternational Other01.01.151,00
Pavel KovalskiInternational Other01.02.140
Pavel KovalskiInternational Other01.02.150
Pavel KovalskiInternational Other01.02.151,00
Kirill AbramovBanks01.03.140
Kirill AbramovBanks01.04.141
Kirill AbramovBanks01.05.14
Kirill AbramovBanks01.06.14
Kirill AbramovBanks01.07.14

I need to find the latest month with the biggest value of each person, thus I will find the the latest active account of a person.

Anonymous
Not applicable
Author

Still not very clear, so I have to make assumptions that could be right or wrong:


1. Month field format is DD.MM.YYYY, that is 01.02.14 is February 2014.
2. You want to find the largest value per person, and then the last date when it value occurs.  And, you want this in the script, not the front end.
3. Find the Account of the record identified in #2.  (I'm confused about this because in your example Account to Person is one-to-one relation, there is nothing much to find.)

Anyway, if my assumptions are correct, see the attached app.  Either it helps you to go forward, or you'll clarify further what you need.