function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Antti KaatonenAntti Kaatonen 

12 months running sales


Hello wizards, what's wrong with this code? First it says it doesn't recognize >= and <= and when you add quotations, it starts with: syntax error missing ')'. Trying to do 12 months running sales. Please help.
 
IF(
  AND(Opportunity.CloseDate">=" (TODAY() - 365),
    Opportunity.CloseDate "<=" TODAY()
  ),
  Opportunity.ExpectedRevenue,
  0
)
SwethaSwetha (Salesforce Developers) 
HI Antti,
Does this modified snippet help?
 
IF(
  AND(Opportunity.CloseDate >= (TODAY() - 365),
    Opportunity.CloseDate <= TODAY()
  ),
  Opportunity.ExpectedRevenue,
  0
)


Thanks
Antti KaatonenAntti Kaatonen
Hello, no it didn't, now it says: Incorrect parameter type for operator '>='. Expected Number, received Date. 
I'm trying to do Summary-Level Formula Column with formula output type as number (I don't know if these are correct).

A little bit background: I already have a fiscal year as a expected close date in filters. Now I'd like a 12 months running sales data on the side. I suppose only way to do this is a formula?