1 Reply Latest reply: Aug 3, 2012 11:44 AM by Matthew Crowther RSS

    Avoid resident table to calculate a field in LOAD Statement

    Chirag Chhatralia

      Hi All,

       

      Not entirely sure whether this can be done however my question is whether somehthing can be done more efficently and cleanly.

       

      My script is as follows:-

       

      Stock:

      LOAD

      Item,

      Quantity

      From "qvd file A";

       

      Outer Join (Stock)

      LOAD

      Item,

      Delivery,

      Dispatch

      From "qvd file B";

       

      AvailableStock:

      LOAD

      Item,

      Quantity,

      Delivery,

      Dispatch,

      Quantity + Delivery - Dispatch as AvailableLevel

      Resident Stock;

      DROP Table Stock

       

      Is there a cleaner means to achieving the same thing i.e. do away with having to load the table in from memory and then drop it?

       

      Thanks in advance.

      C

        • Re: Avoid resident table to calculate a field in LOAD Statement

          I don't think there's a quicker / neater way to achieve the same end result as the fields for the 'AvailableLevel' colculation only come together after the Outer Join.

           

          If ther they were already together you could use a preceeding load to get to the end result:

           

          AvailableStock:

          Load *,

               Quantity+Delivery-Dispatch as AvailableLevel;

          Load Item,

               Quantity,

               Delivery,

               Disptach

          From "Ready Merged QVD File";

           

          But I'm assuming that's not an option.

           

          Apologies I couldn't be more assistance.

           

          All the best,

           

          Matt - Visual Analytics Ltd

          Qlikview Design Blog: http://QVDesign.wordpress.com

          @QlikviewBI