9 Replies Latest reply on Aug 23, 2018 9:18 PM by inder mehta

Last two years of sum sales on selecting current Year.

hi guys how to achieve this if I select current year 2018 it should show last 2 years of sum sales with current year.

if i select 2018 it should show sum sales of 2017,2016.. select 2018 and show values of 2018,2017,2016..

• 1. Re: Last two years of sum sales on selecting current Year.

How are you selecting your current year? Using a filter or parameter?

Okechukwu Ossai I am selecting year with parameter.

• 3. Re: Last two years of sum sales on selecting current Year.

Hi Inder

Because this question is quite vague, I'm going to make an assumption about your desired output, as well as the fact that you're using a "Select Year" parameter.

Create this parameter > List > Add From Field > Year (dimension) to populate the dropdown options.

To show only dates including and earlier than the selected date, I made a calculated field "Hide Future Dates" below and set to true:

Now you want a running sum of the sales value per year: right-click on SUM([SALES]) > Quick Table Calculation > Running Total

I've added in another screenshot to illustrate how selecting another date displays the running sales value up until that point.

Regards,

Steffi

• 4. Re: Last two years of sum sales on selecting current Year.

Hi, Inder

Below is the screenshot of the calculation and result. Please let me know if you have further question

Hope this helps

ZZ

• 5. Re: Last two years of sum sales on selecting current Year.

Steffi B Let me make it clear to you see i am creating a parameter for year. now from parameter control i am selecting years.  when i select 2018 it should show sum sales for 2018,2017,2016. likewise when i select 2017 it should show sum sales for 2017,2016,2015 and when i select 2016 it should show value for 2016,2015,2014. now hope this question is clear to you..

Regards

Inder

• 6. Re: Last two years of sum sales on selecting current Year.

Hi Inder,

What dimensions do you have in the view?

By sum(sales) do you mean fixed total sales for those years and by value do you mean individual sale amounts?

Is there a logic behind the year selection? Do you want to show sum sales for current year and previous year but show value when the difference in year from current year is > 1?

Ossai

• 7. Re: Last two years of sum sales on selecting current Year.

inder mehta  all you have to do is change the calculated field to display the sum of the current + previous 2 years of sales.

Steffi B Its working.

Thanks