
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using For next loop i want to remove column C2,C3,C4 record when C1 is even.other wise if C1 is odd then store data as it is.
[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.
- Tags:
- help needed


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this what you are looking for?
LOAD C1, C2, C3, C4
FROM ....
Where Mod(C1, 2) = 0;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
actually I want to return
:C1, C2, C3, C4
1, null, null, null
2, a2, b2, c2
3, null, null, null
4, a4, b4, c4
5, null, null, null
6, a6, b6, c6
7, null, null, null
8, a8, b8, c8,
9, null, null, null
10, a10, b10, c10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
