5 Replies Latest reply on Jan 4, 2019 3:48 AM by Zhouyi Zhang

# Current month and YTD Sales

Hi All,

I have data from January to December.

I want to show current month and YTD sales in same sheet.

eg:

i selected feb in filter it show feb sale and YTD = Jan+ feb sales in single view

i selected mar in filter it show mar sale and YTD = Jan+ feb + mar sales in single view

i selected apr in filter it show apr sale and YTD = Jan+ feb + mar + apr sales in single view

etc...

i create one parameter and i write below logic i got output like that only

i want to show apr and YTD = Jan+ feb + mar + apr

but it's show apr and YTD = Jan+ feb + mar only

date int is parameter

thanks,

chowdary

• ###### 1. Re: Current month and YTD Sales

Hi, Chowdary

You need create two more calculations individually for current month and ytd.

[curr_Month_sales]:

sum(if [Current Month] = 'Currrent Month' then [sales] end)

[YTD]:

sum(if [Current Month] <> 'others' then [sales] end)

Hope this helps

ZZ

• ###### 2. Re: Current month and YTD Sales

Hi Chowdary,

In the calculation you have used, i guess you have missed giving '<=' for the first row of calculation which will give from starting of the month to till selected month.

if month(order date)<= date then 'YTD'

else-if month(order date) = date then 'current month'

else 'others'

end.

Thanks & Regards,

Ravikiran S

• ###### 3. Re: Current month and YTD Sales

i think it's not working

Please can you send me workbook

• ###### 4. Re: Current month and YTD Sales

hi,

i have to tried that one also but not working

• ###### 5. Re: Current month and YTD Sales

Can you send a sample workbook which reflects your issue as solution may be various depending on what your data looks like?

ZZ