Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qliklearnervir
New Contributor III

Need expression for 1 year data

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.

4 Replies
hrlinder
Honored Contributor

Re: Need expression for 1 year data

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.

MVP
MVP

Re: Need expression for 1 year data

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.

qliklearnervir
New Contributor III

Re: Need expression for 1 year data

Hi,

there 1 more trick is there that i have to generate username and ids:

(1) track the calculation from user's last login date

(2) from last login date  to till 1 year user don't have any login activity

means in between our range like <= TOday() and >=TOday()-1 , we have to find out those user list who have not login from there last login in this time period.

MVP
MVP

Re: Need expression for 1 year data

Hi,

If you attach sample file then it would be easier to understand the data and give the solution.

Qlik Community Tip: Posting Successful Discussion Threads

Check above link, it helps you in getting the answers faster.

Regards,

Jagan.

Community Browser