Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
agni_gold
Specialist III
Specialist III

Previous Year Sales On Current year Bar

Hi Friends ,

I have a situation , i have selected yes from my year filter , and i am showing  , current year sales and previous year sales , but it is giving 2 years in X axis , one for current and one for previous ,

I want Prevous sales bar should come with current year bar.

6 Replies
agni_gold
Specialist III
Specialist III
Author

swuehl‌ any help on this please.

antoniotiman
Master III
Master III

Hi,

Dimension Year

Expression Sum({<Year={'>=$(=Max(Year))<=$(=Max(Year)-1)'}>} Amount)

Regards,

Antonio

swuehl
MVP
MVP

Not sure what you mean with 'selected yes from my year filter'

You also don't mention what should be shown with no value selected.

You can probably do what you want using set analysis in your two expressions to filter on the years to compare and either use no dimension or a TOTAL qualifier. See attached.

Or use chart inter record functions like above, maybe in combination with advanced aggregation, or have a look at AsOf tables as described e.g. in

The As-Of Table

2017-06-25 09_12_49-.png

agni_gold
Specialist III
Specialist III
Author

Thanks

'selected yes from my year filter'

I was writing, Selecting Year from list box,

But I need Year as a dimension in the chart and on nothing selection, I want all years should come.

swuehl
MVP
MVP

Then you can use for example chart inter record functions (in combination with advanced aggregation) or an AsOf table aaproach (or may also other approaches, depending on what you really need to achieve).

For example:

=Sum(Amount)

=Aggr(Above(Sum({1} Amount)),(Year,(NUMERIC,ASC) ) )

in your chart with dimension Year.

agni_gold
Specialist III
Specialist III
Author

As of table seems good approach , thanks Stefan !