Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the previous month count

How to get the previous month count, as per attached example need the previous month (Mar’15) count in current month (Apr’16) for the same department


Please Help. Thanks in advance

1 Solution

Accepted Solutions
pho3nix90
Creator II
Creator II

Please see attached

View solution in original post

15 Replies
sunny_talwar

May be used Above() function or use As-OfTable in the script: The As-Of Table

ramasaisaksoft

Hi Ashok,

could you please check for Accumulation  is Same?

else you need follow Sunny advice.

Not applicable
Author

Hi Sunny. Thanks for your quick reply.

I tried to using above function but for the first month my results shows 0. Please advice as i am new to qlikview.

Digvijay_Singh

Can you share formula used for May month, as it is showing previous month count, March month might not be under  current selection values so it should read beyond current selection through different ways as suggested above.

Not applicable
Author

Please see the used below expression for previous count

if(Month='Apr',

sum(aggr(count({$<Active_Flag = {1},Cal_Year = {'$(vPrev_Year)'},Cal_Year_Flag = {1},Cal_Month =>}Distinct [Employee Code]),Department)),

sum(aggr(above(Count({<Cal_Month_Flag = {1},Cal_Year = {'$(vMax_Year)'},Active_Flag= {1}>}Distinct [Employee Code])),Department,Month)))

sunny_talwar

Would you be able to share the application you are working with?

Not applicable
Author

Please find the attached working application. Please check and advise. !

pho3nix90
Creator II
Creator II

Give this a shot

sunny_talwar

This?

Capture.PNG

Expression:

If([Current Active] > 0,

RangeSum(above(Count({<Cal_Month_Flag = {1},Cal_Year = {'$(vMax_Year)'},[Active Flag DayWise] = {1}>}Distinct [Employee Code])),Department,Cal_Month))