4 Replies Latest reply: Aug 26, 2015 4:01 AM by jagan mohan rao appala RSS

    Need expression for 1 year data

    vir vir

      Hi,

       

      My requirement is given below:

       

      I have to show list of user , who have not logged in in the portal from 1 year from there last login .

       

       

      fields are Login_Date, User_ID,User_name

       

       

      please suggest .

       

      Load Login_Date,User_ID,User_name

      From (./Login.qvd)(qvd)

      where  Login_Date <= Today() and Login_Date >= Addyears(Today()-1)

      NotExist(User_ID);

       

       

      KIndly suggest how to do this equation.

        • Re: Need expression for 1 year data
          Rudolf Linder

          I suggest the following order

          1) load your login data

           

          LogTable:

          load

          Login_Date,User_ID

          From (./Login.qvd)(qvd)

          where  Login_Date <= Today() and Login_Date >= Addyears(Today()-1) ;

           

          InActiveUser:

          noconcatenate Load

          User_ID,

          User_Name

          from (userdata.qvd)

          where not exists(User_ID)

           

          If you load your user earlier, than you need to rename  the User_ID.

          • Re: Need expression for 1 year data
            jagan mohan rao appala

            Hi,

             

            Try like this

             

            Load Login_Date,User_ID,User_name

            From (./Login.qvd)(qvd)

            where  Login_Date <= Today() and Login_Date >= Addyears(Today(), -1);

             

            This will load only those records which are in the last year from current date. i.e, 26-Aug-2104 to 26-Aug-2015.

             

            If you have master table for users then you can load those users detials.

             

            InActiveUser:

            User_ID AS InActiveUserID,

            User_Name AS InActiveUser

            from (Users.qvd) (qvd)

            WHERE NOT Exists(User_ID);

             

            Now if you use below expression you will get the inactive count

             

            =Count(Distinct InActiveUserID)

             

            Hope this helps you.

             

            Regards,

            Jagan.