7 Replies Latest reply: Feb 15, 2017 7:37 AM by dineshraj ramesh RSS

    issue with use of SetAnalysis to variables for previous year and month

    Supriya R

      Hi,

       

      i am trying to get count of previous year and previous month using setanalysis to variables, where it gives me zero, even though i have value for it.

       

      in front end

      count({<client_id={'15'},DateType = {'invitation'},Month_Num = {"$(=num(Month(AddMonths(today(),-1)),'00'))"},Year = {"$(=year(max(CanonicalDate))-1)"} >}invitation_id)

      results in 2334

       

      In script with setanalysis and variables:

      what i tried:

      let var3 = 'count({<client_id={''13''},DateType = {''invitation''},Month_Num = {"$' &'(=num(Month(AddMonths(today(),-1)),'00'))"},Year = {"$' &'(=year(max(CanonicalDate))-1)"} >}invitation_id)';  // this gives error


      let var1 = 'count({<client_id={''13''},DateType = {''accessed''},Month_Num = {"$' &'(=num(Month(AddMonths(today(),-1))))"},Year = {"$' &'(=year(max(CanonicalDate))-1)"} >}invitation_id)';

       

      let var2 = 'count({<client_id={''13''},DateType = {''accessed''},Month_Num = {"$' &'($' &'(=num(Month(AddMonths(today(),-1)))))},Year = {"$' &'($' &'(=year(max(CanonicalDate))-1))"} >}invitation_id)';

       

      all this gives me zero in front end.

      $(var1) results zero

      $(var2) results zero


      What i am missing here? Please help me on this.