6 Replies Latest reply: Mar 13, 2018 2:13 AM by dion verbeke RSS

    Invoice ID Count

    Raman Raghav

      Hi All,

      I was trying to calculate number of invoices in last 12 months, I used the following expression but Im getting an error 

      if(DATE(date#(paid_date_trend, 'YYYYMMDD') ,'DD/MM/YYYY')>=addmonths(today(),-12) , Count(distinct if(vSpendType = 'Sourceable', (if(is_sourceable = 'Y', [Invoice ID]))

                     , if(vSpendType = 'SC Manageable', (if(is_sc_manageable = 'Y', [Invoice ID]))

                     , [Invoice ID]))))


      Variables I used :

      vSpendType = 'Sourceable'