Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

LOGIN DETAILS LAST 3 MONTHS DATA

hi all,

below is my requirement and sample data

No of times user logged  Past 3 months


data


note date format is MM/DD/YYYY


  

USERNAMELOGIN HISTORY
x11/1/2016
x12/1/2016
x13/1/2016
x14/1/2016
x15/1/2016
x16/1/2016
x17/1/2016
x18/1/2016
x19/1/2016
x110/1/2016
x111/1/2016
x21/1/2016
x22/1/2016
x23/1/2016
x24/1/2016
x25/1/2016
x26/1/2016
x27/1/2016
x28/1/2016
x39/1/2016
x310/1/2016
x311/1/2016
x31/1/2016
x32/1/2016
x33/1/2016
x34/1/2016
9 Replies
sunny_talwar

May be like this:

Dimension

USERNAME

Expression

Count({<[LOGIN HISTORY] = {"$(='>' & Date(AddMonths(Max([LOGIN HISTORY]), -3), 'MM/DD/YYYY') & '<=' & Date(Max([LOGIN HISTORY]), 'MM/DD/YYYY'))"}>}USERNAME)

sunny_talwar

Or this if it is last 3 months from today

Count({<[LOGIN HISTORY] = {"$(='>' & Date(MonthStart(Today(), -3), 'MM/DD/YYYY') & '<=' & Date(MonthEnd(Today()), 'MM/DD/YYYY'))"}>}USERNAME)

manoranjan_d
Specialist
Specialist
Author

can you provide me in the script level bcoz this expression will make performance issue?

sunny_talwar

You want to bring in only last three months of data?

manoranjan_d
Specialist
Specialist
Author

yes in the front end application i want to show the last three months data

manoranjan_d
Specialist
Specialist
Author

but same time i m using the master calendar in the script level

sunny_talwar

Then use a where statement

LOAD USERNAME,

          [LOGIN HISTORY]

FROM ....

Where [LOGIN HISTORY] > AddMonths(Today(), -3);

manoranjan_d
Specialist
Specialist
Author

can you pls provide me in the qvw file i want to check this

manoranjan_d
Specialist
Specialist
Author

hi can we use this

=Count({< [LOGIN HISTORY] = {"$(='>' & Date(MonthStart(Today(), -3), 'MM/DD/YYYY') & '<=' & Date(MonthEnd(Today(),-1), 'MM/DD/YYYY'))"}>}USERNAME)

becoz ur monthend false on 30nov2016

i need from 1augto 31oct

so is this fie a?