Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a field 'Date' and Interval which determines my Next_Check_Date,
Date | Interval(days) |
---|---|
20/5/2014 | 700 |
21/5/2014 | 30 |
22/5/2014 | 3 |
I have to apply the following logic to find out my Next_Check_Date
for(Date+Interval<today(),
(Date+ Interval) + Interval ) and so on
This should give my Next_Check_Date,
Thanks
You can try something like this
Load
Date,
Interval,
Date + (Interval * iterNo()) AS Next_Check_Date
FROM .....
While (Date + (Interval * iterNo())) < Today();
Hi,
You can try something below
for i=0 to Date(Today(),'DD/MM/YYYY')-(Date+Interval)
...
..
Next i;
didn't understood your statement. (Date+ Interval) + Interval ) for next check date.
HTH
Sushil
You can try something like this
Load
Date,
Interval,
Date + (Interval * iterNo()) AS Next_Check_Date
FROM .....
While (Date + (Interval * iterNo())) < Today();
I'll Explain, My Date Values should keep on incrementing according to the Intervals until it crosses the current date.
Hope its understood.
sushil rathore wrote:
Hi,
You can try something below
for i=0 to Date(Today(),'DD/MM/YYYY')-(Date+Interval)
...
..
Next i;
didn't understood your statement. (Date+ Interval) + Interval ) for next check date.
HTH
Sushil
Ur logic is exactly what i want But its not working
Can you post your script? So that I can take a look for the issue.
I just took a sample ,
Int:
LOAD Date + (Interval * iterNo()) AS Next_Check_Date
INLINE [
Date, Interval
20/5/2014, 700
21/5/2014, 30
22/5/2014, 3
];
While (Date + (Interval * iterNo())) < Today();
Both while and load statement are single statement. Don't split it
Int:
LOAD Date + (Interval * iterNo()) AS Next_Check_Date
INLINE [
Date, Interval
20/5/2014, 700
21/5/2014, 30
22/5/2014, 3
]
While (Date + (Interval * iterNo())) < Today();
doesnt make a difference, I tried by taking resident load as well,
Can you check whether the date format mentioned to the variable is same as that are in the inline table?
SET DateFormat='DD/MM/YYYY';