logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Lexa  
#1 Posted : Thursday, September 24, 2020 12:53:58 PM(UTC)
Lexa

Rank: Newbie

Groups: Registered
Joined: 9/24/2020(UTC)
Posts: 2
Germany

Thanks: 1 times
How can i create a bar chart to compare an amount of the current years month to the last years month. The bars schould
be side by side like this:

Code:

    |
800 |
    |
700 |              x o           o        
    |    o   x o   x o         x o   x     x o   x o   
600 |  x o   x o   x o         x o   x o   x o   x o   x o   
    |  x o   x o   x o   x     x o   x o   x o   x o   x o   x o   x o   x 
500 |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
    |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
400 |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
    |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
300 |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
    |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
200 |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
    |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
100 |  x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o   x o
------------------------------------------------------------------------------
        J     F     M     A     M     J     J     A     S     O     N     D
 
      x =2020 o =2019

Edited by user Thursday, September 24, 2020 1:12:10 PM(UTC)  | Reason: Not specified

epf  
#2 Posted : Friday, September 25, 2020 7:20:15 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
To do that:
* Create a model having 'Order Date' in Row, 'Order Year' in Column, 'Amount' in Data
* Set a restriction to limit the order years
* Change the SQL of 'Order Date' using the custom SQL property to get only the month: month(Orders.OrderDate) for SQLServer or MS Access
Then change the Data Type to numeric
* Configure the serie: 'Order Date' is Axis, 'Order Year' is a Splitter, 'Amount' is a bar chartJS
In 'Amount' set Sort Type to 'By Axis Label'

Then it should work.

If you want the month with their name, you have to create manually a small enumerated list for Months having the property 'Used defined position to sort in reports' to true, then assign it to 'Order Month' in the Custom Enum property.

I have attached the sample for Northwind SQLServer...
16-Sales comparison per month.srex (6kb) downloaded 2 time(s).

Edited by user Friday, September 25, 2020 7:37:13 AM(UTC)  | Reason: Not specified

thanks 1 user thanked epf for this useful post.
Lexa on 9/25/2020(UTC)
Lexa  
#3 Posted : Friday, September 25, 2020 10:58:10 AM(UTC)
Lexa

Rank: Newbie

Groups: Registered
Joined: 9/24/2020(UTC)
Posts: 2
Germany

Thanks: 1 times
Thank you for the excellent description. That works!
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.