Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
canmarroig
Contributor

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
Esteemed Contributor

Re: Data rolling 6 years from last reload time

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);

4 Replies
isorinrusu
Contributor III

Re: Data rolling 6 years from last reload time

Try something like this:


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


Load *

From X

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

YoussefBelloum
Esteemed Contributor

Re: Data rolling 6 years from last reload time

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
Contributor

Re: Data rolling 6 years from last reload time

Tks

YoussefBelloum
Esteemed Contributor

Re: Data rolling 6 years from last reload time

you're welcome good luck