Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a simple query which you can answer.
I have a table
Date Customer_Name Purchase_count
10-09-2017 John 430
10-09-2017 Ryan 400
10-09-2017 Martin 200
11-09-2017 John 450
11-09-2017 Ryan 400
11-09-2017 Martin 580
12-09-2017 John 700
12-09-2017 Ryan 300
12-09-2017 Martin 210
I want to display 2 KPI values for 'Martin' for 2 different periods.
KPI 1: Period 1 Purchase count for Martin(This Month) : Sum of all days Purchase_count for this month
KPI 2: Period 2 Purchase count for Martin(Last Month) : Sum of all days Purchase_count for last month
Can any one please help me with the expression which I can use to filter this data.
Please never mind if this is an easy question. Thanks.
for current month:
sum( {< Customer_Name = {'Martin'}, Date = {">=$(=MonthStart(Today()))<=$(=MonthEnd(Today()))"} >} Purchase_count )
for last month:
sum( {< Customer_Name = {'Martin'}, Date = {">=$(=MonthStart(AddMonths(Today(), -1)))<=$(=MonthEnd(AddMonths(Today(), -1)))"} >} Purchase_count )
Hello,
Please provide a sample data.
Regards,
Kavita
for current month:
sum( {< Customer_Name = {'Martin'}, Date = {">=$(=MonthStart(Today()))<=$(=MonthEnd(Today()))"} >} Purchase_count )
for last month:
sum( {< Customer_Name = {'Martin'}, Date = {">=$(=MonthStart(AddMonths(Today(), -1)))<=$(=MonthEnd(AddMonths(Today(), -1)))"} >} Purchase_count )
Thank you so much. It got some data. Let me check accuracy.