Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

take off 1 day on load script

Hi everyone, could you please help me to modified the following load script?

Load

GRTVAL_CMPVER,
GRTVAL_CODCOF,
GRTVAL_DEBAJA,
GRTVAL_FECALT,
GRTVAL_FECCAL,
Year(GRTVAL_FECCAL) & Num(Month(GRTVAL_FECCAL),'00') & Num(Day(GRTVAL_FECCAL),'00') as %Key_CREATED_ITEMS_MOVIMIENTOS_VENTAS,
GRTVAL_FECMOD,
GRTVAL_HORMOV,
GRTVAL_LOTORI,
GRTVAL_LOTREC,
GRTVAL_LOTTRA,
GRTVAL_MODULE,
GRTVAL_OALIAS,
GRTVAL_SYSVER,
GRTVAL_TSTAMP,
GRTVAL_ULTOPR,
GRTVAL_USERID,
GRTVAL_VALORI
FROM (qvd)

what i have is

datevalue
10/1/20144
10/2/20145
10/3/20146
10/4/20147

but what i need is

datevalue
10/2/20144 (10/1/2014 value)
10/3/20145 (10/2/2014 value)
10/4/20146 (10/3/2014 value)
10/5/20147 (10/4/2014 value)

is it clear?

thanks!

7 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Just do this in your load script.

Here DATE_FIELD is your field that you are trying to take off one day.

Date(Timestamp(DATE_FIELD-1),'MM/DD/YYYY') as DATE

MarcoWedel

Load date,

          previous(value) as value

Form yoursource;

MarcoWedel

Load date(date+1) as date,

          value

From yoursource;

cspencer3
Creator II
Creator II

You may actually want to do this in the table you are displaying the data in itself. This could be done using the ABOVE() function. This function will display the value of a cell that is a specified distance above. The Syntax is:

Above([TOTAL] Expression [,Offset[,n]]).

If you do not specify or use the TOTAL qualifier it will default to displaying the value of the row directly above it. If this is something that has to be done in the load script however, this will not help

Not applicable
Author

Great! This works! Thanks

Sent from my Windows Phone

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Seems you question is answered. Can you mark this thread as "Correct Answer" and/or "Helpful answer"? so that rest can find this useful.

Not applicable
Author

Sure...its what i was looking for...

Sent from my Windows Phone