Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Latest Date Read From Set of Data from a file

ramang22522684
Level 2
Level 2

Hi Team,

I want to get the latest date from a date column of a data file.

So could you please help me with some JS code which could server this functionality for me.

Regards

Raman

1 Accepted Solution
florentlb
Correct answer by
Level 10
Level 10

Hi,

I don't know much about JS code but one way of doing that could be to use an enrichment activity. By creating a link to the imported file as a collection, you will be able to retrieve the line (and thus its value) corresponding to the most recent date contained in the column.

If you absolutely want do to it by JS, you can query the temporary table containing the data of the file using an sqlExec command to select the Max date of the column where dates are stored.

Hope this helps,

Florent

View solution in original post

1 Reply
florentlb
Correct answer by
Level 10
Level 10

Hi,

I don't know much about JS code but one way of doing that could be to use an enrichment activity. By creating a link to the imported file as a collection, you will be able to retrieve the line (and thus its value) corresponding to the most recent date contained in the column.

If you absolutely want do to it by JS, you can query the temporary table containing the data of the file using an sqlExec command to select the Max date of the column where dates are stored.

Hope this helps,

Florent

View solution in original post