SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Displaying Months As Series - Ordering by Month Number


Displaying Months As Series - Ordering by Month Number

Author
Message
j-1064772
j-1064772
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4493 Visits: 1262
Q1 - Forcing the proper sequence of months in a chart ?

From a cube holding a set of invoices, how - for a specific year - to show the total amounts in a chart for each month ? The chart shows up ordered as April, August, December, February ...

Q2 - How to set the year filter ?

I created a Date dimension linked to the Invoice Measure table. The Year field of the date dimension is the "Series" section for the chart (report in the sharepoint designer). It was not possible to enter the year field in the "Background" section of the chart report.

I ended up creating an additional date dimension (I called it "FilterYear").

Was this really the only way to be able to do it ?

Regards
Luis Cazares
Luis Cazares
SSC Guru
SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)

Group: General Forum Members
Points: 158573 Visits: 22556
For Q1:
You need to set different values for the Value and Label properties for your month attribute in the date dimension.

For Q2:
You need to build a hierarchy to be able to use date parts as your filters.


Luis C.
General Disclaimer:
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?


How to post data/code on a forum to get the best help: Option 1 / Option 2
j-1064772
j-1064772
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4493 Visits: 1262
Thank you for your speedy reply.

OK, I got the value/label business - that's in Visual Studio when editing the dimension.
(value would be the month number and the label the month name ?)

I would appreciate a bit more help - on how to setup the hierarchy within the date table.

The columns are

DateKey (primary key, type: date), contiguous range of everyday from Jan 1 2007 up to Dec 31 2016)
DateString (varchar(10), date formatted as yyyy-mm-dd)
DateYear (integer YEAR(DateKey))
DateMonth (integer MONTH(DateKey))
DateDay (integer, DAY(DateKey))
MonthYear (integer, YEAR(DateKey) * 100 + MONTH(DateKey))
EnglishMonthName (varchar(20), DATENAME(mm, DateKey))


I am a still a bit confused as to what should be "pointing" to what.

Finally, the use of the hierarchy would mean I did not need to create an extra table to use as filter ?

Regards
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search