Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I would like to first load a table looking like this:
TAB:
LOAD * INLINE [
Article, QTY, Sales
a, 0, 1
a, 0, 1
a, 0, 5
a, 2, 1
a, 0, 5
b, 0, 5
b, 0, 5
c, 0, 5
c, 8, 5
c, 8, 5
];
Then, ONLY if the sum of 'b' = 0 load an additional table like this:
Concatenate (TAB)
LOAD * INLINE [
Article, QTY, Sales
b, 8, 1
];
I already tried (without success) with this part of script after the first inline table:
Controltab:
LOAD
sum(QTY) as Control_B
Resident TAB
Where Article= 'b';
if Control_B = 0 THEN
LOAD * INLINE [
Article, QTY, Sales
b, 8, 1
];
end if;
It doesn't load the new set of the second inline-table. If I removed the if-statement it loads.
Any idea what could help? Thank you in advance 🙂
Use the Peek function:
TAB:
LOAD * INLINE [
Article,QTY,Sales
a,0,1
a,0,1
a,0,5
a,2,1
a,0,5
b,0,5
b,0,5
c,0,5
c,8,5
c,8,5
];
Controltab:
LOAD
sum(QTY) as Control_B
Resident TAB Where Article='b';
LET B=Peek('Control_B',0,'Controltab');
DROP Table Controltab;
if $(B)=0 THEN
LOAD * INLINE [
Article,QTY,Sales
b,8,1
];
end if
Hi Piet!
thank you very much - it works perfectly!