Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
canmarroig
Partner - Creator
Partner - Creator

Data rolling 6 years from last reload time

Hi, i've a field Date time formatted as 01/04/2018, in script i've to set 6 years previous data load  not from today but from the last data reload that is max(datetime). My calendar should be expressed in as Monthname (04/2018). I'm not able to translate in script, can you help me?

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

Hi,

try this:

Max:

Load

Max(D_FINE_VAL) as MaxDate

Resident your_table;

Let vMax = FieldValue('MaxDate',1);

Drop Table Max;

your_table:

LOAD

.

Date(Date#(Date,'DD/MM/YYYY'),'MM/YYYY') as Date,

.

.

FROM...

WHERE Date>addyears($(vMax),-6);

View solution in original post

4 Replies
isorinrusu
Partner - Creator III
Partner - Creator III

Try something like this:


Let vLastReload = Date(floor(ReloadTime()));


Load *

From X

Where yourDate >= Addmonths('$(vLastReload)',-72);

YoussefBelloum
Champion
Champion

Hi,

try this:

Max:

Load

Max(D_FINE_VAL) as MaxDate

Resident your_table;

Let vMax = FieldValue('MaxDate',1);

Drop Table Max;

your_table:

LOAD

.

Date(Date#(Date,'DD/MM/YYYY'),'MM/YYYY') as Date,

.

.

FROM...

WHERE Date>addyears($(vMax),-6);

canmarroig
Partner - Creator
Partner - Creator
Author

Tks

YoussefBelloum
Champion
Champion

you're welcome good luck