2 Replies Latest reply: Oct 29, 2018 11:47 AM by Gaspar Benito RSS

    Condition in Set expression

    Gaspar Benito

      Hi all,

       

      Can someone help me with this?

       

      I have an Excel file with a list of costs per line, according to the product (sale).

      And in the script I have calculated that each of those lines, multiply that cost by the boxes (unit of sale) sold.

       

      Right now, there is only one cost per reference (line), regardless of the year.

      I want to add the year field, as the cost per product varies each year, and now applies the same cost, regardless of the selected year.

       

      The current formula is:

      ApplyMap ('Map_CosteCaja', Mid (% Key_Articulo, FindOneOf (% Key_Articulo, '123456789')), 0) * #Cajas as #CosteVentas

       

      How can I add to this formula the option that if for example, if I select 2017 it uses a cost and if I select 2018 it uses a different cost?

       

      For example: 

      ReferenciaAñoCoste
      10000120171,25
      10000120181,35

       

       

      Thanks in advance!

      Gaspar