2 Replies Latest reply: Apr 18, 2013 2:02 AM by jagan mohan rao appala RSS

    Expressions

      Hi,

      I have two tables and would like to use the information from one to the other one.

       

      One table is a reference table.

      for Material 1234 1 PC = 10 M, or 1 BOX = 100M

       

      Material NumberNumerat.BUnAUn
      1234100MBOX
      123410MPC

       

      the other tables is showing information about the agreement we have.

       

      Material NumberBase UnitPO UnitVolume (Base Unit)Net Price
      1234MPC7975200,66

       

      Question:

      I would like to divide the 'Volume (Base Unit)' with 'Numerat.' if 'AUn' and 'PO Unit' is the same, in this case both have PC

       

      Volume (Base Unit) 7975 should be divided by 10 = 797,5

       

      How should I handle this? either in script or in the expression

       

      Thanks in advance

        • Re: Expressions
          Yusuf Ali

          Hi ,

                Its better to have in Expression of a chart .

          Include the MaterialNumber as Dimension and then in the Expression

          try to have this

          if(AUn=POUnit ,Volume/Numerat)

           

          Please reply me for the same .

          //Yusuf

          • Re: Expressions
            jagan mohan rao appala

             

            Hi,

             

            Join both the tables by using the below script and calculate the values in the script, so that the chart would load faster.

             

            AgreementsTemp:

            LOAD

                 *

            FROM Agreements;

             

            LEFT JOIN (AgreementsTemp)

            LOAD

                 MaterialNumber,

                 Numerat,
                 BUn AS  [Base Unit],

                 AUn AS  [PO Unit]

                 1 AS Temp

            FROM Reference;

             

            Agreements:

            LOAD

                 *,

                 [Volume Base Unit] * Numerat AS NetValue

            RESIDENT AgreementsTemp;

             

            DROP TABLE AgreementsTemp;

             

            Hope this helps you.

             

            Regards,

            Jagan.