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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

last 3 months data

hi all,

i m getting wrong output for past three months data, pls help me on this

x1 has to get 4

x2 has to get 1

x3 has to get 2

where it shd avoid the current month count(november) and it shd get the last three months count for the login history based on the username dimension

pls help me on the wt is correct expression for this?

  

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
x110/2/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
Labels (1)
4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Create a flag field in the script:

LOAD

     USERNAME,

     InQuarter ([LOGIN HISTORY], MonthStart(Today()-1)) * -1 as InLastQuarter,

     ...other fields...

FROM

     ...source-data

     ;


Then create chart with USERNAME as dimension and sum the values of InLastQuarter in your chart expression: sum(InLastQuarter)


talk is cheap, supply exceeds demand
manoranjan_d
Specialist
Specialist
Author

in the script i shd always the base data, ony in the front end i have to show the last three months data

johnw
Champion III
Champion III

Perhaps this, though I prefer my complexity in script rather than in charts where practical.

count({<[LOGIN HISTORY]={"=[LOGIN HISTORY]>=monthstart(today(),-3) and [LOGIN HISTORY]<monthstart(today())"}>} distinct [LOGIN HISTORY])

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I'm suggesting you add a field in the script. I'm not telling you to remove anything. So you will always have the base data. And you'll only limit what you show in the front end with an expression.


talk is cheap, supply exceeds demand