BAQ Sales by Customer

,

Hi everyone,

This is my first post here, I’m pretty much new in Epicor, and I’m trying to do a BAQ using a subquery and PIVOT, I already did it and is working not bad, but the problem is with PIVOT I had to set as a constant list the years. I wonder how can I do this variable?? I mean the next year that list won’t be useful, or maybe a parameter where I could tell the report how many years back I want.

this is the Pivot subquery Clause

And the report should look something like this.
image

I wonder if I should use just subqueries without pivot function.

Thanks in advance for having the time to reading me.

SQL doesn’t allow dynamic pivot columns

You could do something like prior current and next and calculate those values according

Thanks Jose for your answer,

Do you or anybody know if there is another way to do it ??