Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II

How to get modification time of a table ??

Hey,

TO use incremental load for newly added rows how can i get modification time of table ?? So that i can compare it with LAst Execution Time of table and get the updated results or newly added rows  only.

Please help.

Thanx.

20 Replies
marcus_sommer

You could use filetime() - see here a similar post: Optimization of time reload.

- Marcus

nikhilgarg
Specialist II
Author

Hey marcus ,

I can not find any fulltime().

Can you tell me where it is ??

OR if you can tell me how to use it and compare with last execution time ??

Please hlp.

Thanx.

marcus_sommer

filetime() not fulltime ... you will find some explanations by the file-functions within the help.

- Marcus

nikhilgarg
Specialist II
Author

Hey,

I created a column using filetime as:

FileTime()as Modified_time;

Now i want to compare Modified_time with LAstExecTIme() , but Modified_time is not being shown as column.

My COde is :

-------------------------------------

Directory;

LOAD * , FileTime()as Modified_time

FROM

[Disaster_Data\Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster) where Modified_time >= $(LastExecTime); // Here Modified_time is showing error as not assumned to be a column.

Concatenate

LOAD Id,

     StartDate,

     EndDate,

     Country,

     Type,

     Sub_Type,

     Name,

     Killed,

     Injured,

     Year

FROM

disaster1.qvd (qvd) WHERE NOT Exists(Id);

STORE Disaster INTO C:\Users\nikhil.garg\Desktop\disaster1.qvd;

----------------------------------------------------------------------------------------------------

WHat to do ??

Please help.

Thanx.

jvitantonio
Luminary Alumni

Hi Nikhil,

It's not a column until you fully create it. Try this instead:

Directory;

LET vModifiedTime = FileTime(Disaster_Data\Copy of Disaster.xlsx);

LOAD *

FROM [Disaster_Data\Copy of Disaster.xlsx] (ooxml, embedded labels, table is Disaster)

where vModifiedTime >=$(LastExecTime)

;

//****REST OF YOUR SCRIPT***

JV

nikhilgarg
Specialist II
Author

HEy,

I tried the way u did but it is giving me error :

My script is :

----------------------------------------------------------------------------------

Directory;

LET vModifiedTime = FileTime('C:\Users\nikhil.garg\Desktop\Disaster_Data\[Copy of Disaster.xlsx]');

LOAD *

FROM

[Disaster_Data\Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster) where vModifiedTime >= $(LastExecTime);

Concatenate

LOAD Id,

     StartDate,

     EndDate,

     Country,

     Type,

     Sub_Type,

     Name,

     Killed,

     Injured,

     Year

FROM

disaster1.qvd (qvd) WHERE NOT Exists(Id);

------------------------------------------------------------------------------------------

Error is :

jvitantonio
Luminary Alumni

Hi,

Please try this:

...

(ooxml, embedded labels, table is Disaster) where $(vModifiedTime) >= $(LastExecTime);


Add vModifiedTime between $( )


JV

nikhilgarg
Specialist II
Author

Hey,

THanx . I added $() and now it works but now it is giving another error of garbage statement:

Please help.

jvitantonio
Luminary Alumni

I can't debug an app like this. Can you please attach your app and your sample xml so I can work on it? You can put only one like of data