Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

calculate the sales

HI Experts,

I have one year list box in that i am having data like 2010 to 2016 and respected sales

If click on 2013year then i want see the total sales for 2013 ,2012,2011 and 2010.

How to calculate the total based on the selection?

8 Replies
sunny_talwar

So, sales for all years on and before the selected year? May be this...

Sum({<Year = {"$(='<=' & Max(Year))"}>}Sales)

Anonymous
Not applicable
Author

HI Thanks for the reply,

The above expression is correct  but at the same time it is calculating the all months from all years right?

But if i click on 2013 year and 4 th month then how to calculate ?

sunny_talwar

What should happen when you select the 4th month? You want to see the sum of sales of 4th month for 2013, 2012, 2011... etc?

Anonymous
Not applicable
Author

When we select "2013" and month "04" we would see 2010 - 2013 (correct!) but only for month 04

i  want to see 2010 - 2012 month 1-12 and 2013 month 1 - 4.

sunny_talwar

May be create a monthcounter in the script for Master Calendar like this

AutoNumber(MonthName(Date)) as MonthCounter

and then use this

Sum({<Year, MonthCounter = {"$(='<=' & Max(MonthCounter))"}>}Sales)

Anonymous
Not applicable
Author

hi,

The month field is available in my data model and if i use the below expression then i am getting correct data for years

Sum({<Year = {"$(='<=' & Max(Year))"}>}Sales) but i want months also

Masi_Sahargahi
Contributor III
Contributor III

Hi,

if you have date field,you can use max of date in set analysis,

I have done a simple scenario in attached file,I hope it can help.

sunny_talwar

You want months also? I am not sure I follow?