Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
sspawar88
Creator II
Creator II

How i can get data for last 4 months & date is in MMM-YYYY format

Hi,

I have B.date in num format. I have take it as date(B.date) in script.

then take Date(MonthStart(B.date), 'MMM-YYYY'') as MonthYear fied.

Data is like :

B.dateEmp_NameSalary
2018-02-02A100
2017-12-05B552
2017-08-05C555
2017-06-03D236

I have one pivot table in which dimension is Emp_Name and I want only last four month data of Salary as in expression sum(Salary)

How I Can write a expression?

3 Replies
sunny_talwar

May be this

Sum({<MonthYearField = {"$(='>=' & Date(MonthStart(Max(MonthYearField), -4), 'MMM-YYYY') & '<=' & Date(Max(MonthYearField), 'MMM-YYYY'))"}>}Salary)

sspawar88
Creator II
Creator II
Author

How can I do it at dimension rather than expression

sunny_talwar

May be this

If(MonthYearField >= MonthStart(Max(TOTAL MonthYearField), -4) and MonthYearField <= Max(TOTAL MonthYearField), MonthYearField)