3 Replies Latest reply on Oct 9, 2018 4:48 AM by koushik.neelakantha

# Comparing Latest year CM vs Prior year CM

Hello everyone, I was just going through below link to compare Latest year and prior year sales.

Same way, I just need to compare latest year current month vs prior current month.

Example: 2018 october vs 2017 october.

Help me out.

Regards,

Koushik.

• ###### 1. Re: Comparing Latest year CM vs Prior year CM

hello.

You can try below logic

Latest Month Sales = IF DATEDIFF('month',DATETRUNC('month',[Order Date]),{MAX(DATETRUNC('month',[Order Date]))})=0

THEN [Sales]

END

Prior year sales = IF DATEDIFF('month', DATETRUNC('month',[Order Date]), {MAX(DATETRUNC('month',[Order Date]))}) = 12 THEN [Sales] END

1 of 1 people found this helpful
• ###### 2. Re: Comparing Latest year CM vs Prior year CM

Hi,

If you want to know another way then you can also try with table calculation like this,

Current Month Sales: LOOKUP(SUM([Sales]),LAST())

Previous Year Current Month Sales: LOOKUP(SUM([Sales]),LAST()-12)

Drag your date field and show datepart month year and put it in details shelf. You'll get multiple marks in your view.

Create one filter to get the final view

Filter First Rec: INDEX()=1

Let us know if this help.

Mahfooj

1 of 1 people found this helpful
• ###### 3. Re: Comparing Latest year CM vs Prior year CM

Thanks meenu & Mahfooj

Regards,

Koushik.