Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
| ID | Subid | Area | NewPeek | Required Output |
| 111 | 1 | |||
| 222 | 1 | |||
| 333 | 1 | |||
| 333 | 2 | IND | IND/ | IND |
| 333 | 3 | PAK | PAK/IND | PAK/IND |
| 333 | 4 | /PAK | PAK/IND |
Please help on this need to create new field like "Required Output" .
Try this
Table:
LOAD *,
If(ID = Previous(ID),
If(Len(Trim(Area)) > 0,
If(Len(Trim(Peek('Output'))) > 0,
Peek('Output') & '/' & Area,
Area),
Peek('Output')),
Area) as Output;
LOAD * INLINE [
ID, Subid, Area
111, 1,
222, 1,
333, 1,
333, 2, IND
333, 3, PAK
333, 4,
];
Hi, can you explain the logic you need please?
Try this
Table:
LOAD *,
If(ID = Previous(ID),
If(Len(Trim(Area)) > 0,
If(Len(Trim(Peek('Output'))) > 0,
Peek('Output') & '/' & Area,
Area),
Peek('Output')),
Area) as Output;
LOAD * INLINE [
ID, Subid, Area
111, 1,
222, 1,
333, 1,
333, 2, IND
333, 3, PAK
333, 4,
];
| ID | Subid | Area | NewPeek | Required Output |
| 111 | 1 | |||
| 222 | 1 | IND | IND | |
| 333 | 2 | IND | IND/ | PAK/IND |
| 333 | 3 | PAK | PAK/IND | PAK/IND |
| 333 | 4 | /PAK | PAK/IND |
small change need out put like this....... thanks
What is the Logic here? and can you explain what the output would look if the data was like this
| ID | Subid | Area | NewPeek | Required Output |
| 111 | 1 | |||
| 222 | 1 | IND | IND | |
| 333 | 2 | IND | IND/ | PAK/IND |
| 333 | 3 | PAK | PAK/IND | PAK/IND |
| 333 | 4 | /PAK | PAK/IND | |
| 333 | 5 | AUS | ? |
Will it be AUS/PAK/IND or PAK/IND/AUS or PAK/AUS/IND? Again what is the logic behind the output?
Try this
Table:
LOAD *,
If(ID = Previous(ID),
If(Len(Trim(Area)) > 0,
If(Len(Trim(Peek('Output'))) > 0,
Area & '/' & Peek('Output'),
Area),
Peek('Output')),
Area) as Output;
LOAD * INLINE [
ID, Subid, Area
111, 1,
222, 1,
333, 1,
333, 2, IND
333, 3, PAK
333, 4,
333, 5, AUS
];