18 Replies Latest reply: Feb 2, 2018 2:14 AM by Jonnie Yacoub RSS

    Creating variable last 6 months

    Jonnie Yacoub

      Hey Qlikkers,

       

      I'm trying to create a variable to show only the last 6 months, but it is not working? currently i'm using this in my script:

      datefield

      DATE(lead_inserted, 'DD/MM/YYYY') as date,

       

      the not working variable

      SET v6LastMonth="=Date(AddMonths(Max(Date),-5),'DD/MM/YYYY')";

       

      Dimension:

      =Monthstart(date)

       

      expression:

      count({1<[type]={'deal'},

      [source]-={'Via verhuurder'},

      [date]={'>$(v6LastMonth)'}>}

      deal_id)

      /

      Count({1<[type]={'lead'},

      leadsource -={'Via verhuurder'},

      [date]={'>$(v6LastMonth)'}>}

      lead_id)

       

      Any idea how this could work?