Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a table called equipment and i need one more date column through loop lets say
ColumnA ColumnB ColumnC NewDateColumn
1 a 1234 3-Apr-2014
2 b 5678 3-Apr-2014
3 c 9876 3-Apr-2014
1 a 1234 4- Apr-2014
2 b 5678 4- Apr-2014
3 c 9876 4- Apr-2014
1 a 1234 5- Apr-2014
2 b 5678 5- Apr-2014
3 c 9876 5- Apr-2014
Basically I should have 3 days of date generated for the entire data available in my Table. Lets say for entire data available in the table it should have 3-Apr-2014 and similarly the available data in table should have 4-Apr-2014.Same follows for 5-Apr-2014.
Any help would be appreciated.
Thanks in advance.
Lavanya,
Try in FOR statement convert your variables into NUM
Andrei
Hi,
Try this
Load * Inline [
ColumnA, ColumnB, ColumnC
1, a, 1234
2 , b, 5678
3, c, 9876
1, a, 1234
2, b, 5678
3, c, 9876
1, a, 1234
2, b, 5678
3, c, 9876
];
Let vColumnA = FieldValueCount('ColumnA');
For A = 1 to $(vColumnA)
Let vNewDateColumn = $(A)+2&'-Apr-2014';
For i = 1 to $(vColumnA)
LoopTest1:
Load
*,
'$(vNewDateColumn)' as NewDateColumn
Resident LoopTest;
Next;
Next;
Drop Table LoopTest;
Ahh, I missed the actual issue, it is not about format but the loop variable.
Try:
For i = 0 to (vMax_Equ -vMin_Equ -1 )
Or,
For i = 0 to ($(vMax_Equ) - $(vMin_Equ) -1)
Of course, just replace the inline table with ...
load date(today()+rowno()-1) as NewDate autogenerate 5;
flipside
Hi ,
Thats a great help !! Thank you !!