Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need help with multiplication in LOAD script.
I have source table with about 1000 [reg]. Each [reg] has [start] and [end] date and pcakc. I need multiplication of each [reg] row for [start]-[end] range date.
Source table:
reg | start | end | pcakc |
123456 | 01.01.16 | 10.01.16 | i256 |
Result:
reg | date | pcakc |
123456 | 01.01.16 | i256 |
123456 | 02.01.16 | i256 |
123456 | 03.01.16 | i256 |
123456 | 04.01.16 | i256 |
123456 | 05.01.16 | i256 |
123456 | 06.01.16 | i256 |
123456 | 07.01.16 | i256 |
123456 | 08.01.16 | i256 |
123456 | 09.01.16 | i256 |
123456 | 10.01.16 | i256 |
thx.
Try something like this:
Table:
LOAD reg,
Date(start + IterNo() - 1) as date,
pcakc
While Date(start + IterNo() - 1) <= end;
LOAD * Inline [
reg, start, end, pcakc
123456, 01.01.16, 10.01.16, i256
789101, 03.01.16, 12.01.16, i212
];
Try something like this:
Table:
LOAD reg,
Date(start + IterNo() - 1) as date,
pcakc
While Date(start + IterNo() - 1) <= end;
LOAD * Inline [
reg, start, end, pcakc
123456, 01.01.16, 10.01.16, i256
789101, 03.01.16, 12.01.16, i212
];
thank you very much
No problem. I am glad I was able to help