Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I've always really hated dealling with dates! but now I need to bite the bullet.
I have a table with a number of fields loaded. In the load script I want to change specific records from one value to another based upon the date.
The table has two fields that I want to work with, absolute_time (formated as YYYY-MM-DD 00:00:00 ) and Parameter
What I want to do is....
if Parameter = 'x' and absolute_time is after 1st Jan 2011, then replace Parameter with 'y'.
if Parameter = 'x' and absolute_time is before 1st Jan 2011, then keep Parameter as 'x'
Can somone give me a couple of pointers in how to kick this off?
Thanks
Mark
Hi Mark,
Can you give a try to this expression
if( parameter = 'X' and date(timestamp)>'01/01/2011' , parameter='Y')
Let me know if it didn't worked 4 you
thanks
Meher
Hi Meher,
Thanks, I tried that, but the second "parameter" field name in the expression is not recogised (coloured red) in the load script.
Is something special required for the load script?
Thanks
Mark
Hi:
If the tiemstamp in your function is related to today(), use today().
If the timestamp is a value in one of your tables, use the function peek('field',record,'table') (see help) to retrieve that value.
if the timestamp is a calculation from values on a table, i have to think about it, but it is possible. it could be something like load max(date) resident yourtable;
Specify a little more please.
luck.
Hi Mark,
Can you give a try with variables.
set varA = 'X'
Set varB = 'Y'
if( parameter = $(varA) and date(timestamp)>'01/01/2011' , parameter= $(varB) )
If possible can you upload your script. which clarifies me more
thank you
Meher