Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sagaraperera
Creator
Creator

PREVIOUS MONTH

Hi All,

I need help...

I want to calculate current month and previous month. Eg. Suppose all data is selected then values show current month(May) data and previous month(April) data, and if user click on April month filter then variable need to show current month as April and previous month as March. Hope you understand the requirement.

SAGARA

MY SCRIPT

CrossTable(DESCRIPTION, ACTUAL, 6)

LOAD BCOD,

     MONTH,

     YEAR,

     MONTH2,

     CLA_CODE,

     MONM,

     GROSS_PREMIUM,

3 Replies
Chanty4u
MVP
MVP

hi perera,

Max(year) give you may

min(year) gives u  jan

May(year)-1  give this filter u vil get previous mnth whn user cliks.

hope this helps u

Thank u

Suresh

gautik92
Specialist III
Specialist III

Max of Month with Year

upper(Date(Max({$<Year={$(=Max(Year))},MonthID={$(=Max(MonthID))}>}Transactiondate),'MMM-YY'))

max of Month-1 with Year

upper(Date(Max({$<Year={$(=Max(Year))},MonthID={$(=Max(MonthID)-1)}>}Transactiondate),'MMM-YY'))

hariprasadqv
Creator III
Creator III

Give an Id for months and get max(mid) and max(mid)-1