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

sum from filetime

Hi All.

I have a many files from one directory.

I need sum values from last file and all other files.

How i can do it?

For example. I have 3 tables:

Table 1 (create 01-01-2014)Table 2 (create 02-01-2014)Table 3 (create 03-01-2014)
NameQuantity
Name 110
Name 220
NameQuantity
Name 330
Name 440
NameQuantity
Name 550
Name 660

In the end I need next datas:

TableSummMy comment
All210Sum by Name 1 - 6
Earler100Sum by Name 1, 2, 3 and 4
Last110Sum by Name 5 and 6

Thanks.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Load all the data into one table and make sure you add the data into a field in that table too.

You can find some code to loop through files here: loop through to load all files from a folder and its subfolders?

If necessary you can use the FileTime() function to retrieve the modification date of the file.

Once you have you can create a table with expressions to get the correct sums:

All: sum(Quantity)

Last: sum({<FileTime={'$(=max(FileTime))'}>} Quantity)

Earlier: All - Last


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Load all the data into one table and make sure you add the data into a field in that table too.

You can find some code to loop through files here: loop through to load all files from a folder and its subfolders?

If necessary you can use the FileTime() function to retrieve the modification date of the file.

Once you have you can create a table with expressions to get the correct sums:

All: sum(Quantity)

Last: sum({<FileTime={'$(=max(FileTime))'}>} Quantity)

Earlier: All - Last


talk is cheap, supply exceeds demand
Not applicable
Author

Gysbert, thank you! It's work