2 Replies Latest reply: Nov 7, 2016 8:20 AM by Gysbert Wassenaar RSS

    Flag creation in Script

    Rajesh G

      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.

         

      TechnologyProject durationAvailable/Over BookedFlag(required field)
      JavaA5AvailableAvailable
      B10Available
      C1Available
      CX-5Over BookedOver Booked
      Y4Available
      Z0Available
      P4Available

      Thanks in advance.

        • Re: Flag creation in Script
          Marcus Sommer

          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

          • Re: Flag creation in Script
            Gysbert Wassenaar

            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

                 ;