Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
[TblRecords]:
load * Inline
[
C1, C2, C3, C4
1, a1, b1, c1
2, a2, b2, c2
3, a3, b3, c3
4, a4, b4, c4
5, a5, b5, c5
6, a6, b6, c6
7, a7, b7, c7
8, a8, b8, c8,
9, a9, b9, c9,
10, a10, b10, c10
];
I have table. I want to Null/Remove column C2, C3, C4 Record when C1 column is even.
Is this what you are looking for?
LOAD C1, C2, C3, C4
FROM ....
Where Mod(C1, 2) = 0;
actually I want to return
load C1, if( Mod(C1, 2) = 0, C2, null()) as C2
,if( Mod(C1, 2) = 0, C3, null()) as C3
,if( Mod(C1, 2) = 0, C4, null()) as C4
;
load * Inline
[
C1, C2, C3, C4
1, a1, b1, c1
2, a2, b2, c2
3, a3, b3, c3
4, a4, b4, c4
5, a5, b5, c5
6, a6, b6, c6
7, a7, b7, c7
8, a8, b8, c8,
9, a9, b9, c9,
10, a10, b10, c10
];
result:
Hi, Even() or Odd() function can help:
LOAD C1,
If(Even(C1), C2, Null()) as C2,
If(Even(C1), C3, Null()) as C3,
If(Even(C1), C4, Null()) as C4