Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I would like to create one new flag with values Available/Over Booked.
Here below is my requirement .
If any one of project "duration" field is negative , I would like to create Flag value as "Over Booked" for whole set of Technology. If "duration" field has all positive values flag value should be "Available" for whole set of Technology.
Let me how can we achieve this requirement.
Technology | Project | duration | Available/Over Booked | Flag(required field) |
Java | A | 5 | Available | Available |
B | 10 | Available | ||
C | 1 | Available | ||
C | X | -5 | Over Booked | Over Booked |
Y | 4 | Available | ||
Z | 0 | Available | ||
P | 4 | Available |
Thanks in advance.
Maybe in this way:
t:
load Technology, Project, duration from YourSource
left join (t)
load Technology, if(min(duration)<0, 'Over Booked', 'Available') as Flag
resident t group by Technology;
- Marcus
Perhaps like this:
MyTable
LOAD
Technology,
Project,
duration,
If(duration >= 0, 'Available', 'Over Booked') as [Available/Over Booked]
FROM
...source data....
;
JOIN (MyTable)
LOAD
Technology,
If(Min(duration)<0, 'Over Booked', 'Available') as [Flag (required field)]
RESIDENT
MyTable
GROUP BY
Technology
;