Showing posts with label x-axis. Show all posts
Showing posts with label x-axis. Show all posts

Wednesday, March 21, 2012

Formatting dates on a chart when sourced from SSAS2k5

I am creating a few charts in SSRS that are sourced from a cube in AS. On the x-axis is time, which is what I assume a date-like field in the cube. On the y-axis is the measure.

My problem is that I cannot seem to get the dates to format on the chart - regardless of the format code I use, the dates appear in long format, like "Thursday, November 23 2006".

Are the dates from SSAS just string values?

I feel that you may have mentioned some expression or modification done on that field.I faced this problem before where i came to know that Format expression which will be like (#000# Something...) when some operation is being performed on that date. Take out that any operation on that field and give only format option or use format function in the expression.

Hope it should work

Regards,

Raj Deep.A

|||Hi Raj,

I'm not sure I follow - I haven't modified the field at all, yet. I merely created an MDX Query using the designer, and Time is one of the dimensions I used to splice my measure by. I wanted to expose this data in a chart, but for some reason I can't apply any standard formatting codes to the Time label on the x-axis.|||

Based on your query in the MDX query generator, the date time value is provided as a string to Reporting Services. That's why format codes won't work.

You could look into either changing your MDX query to get the value as DateTime object (which means you have to hand-write the MDX) or you could try to convert the string back into a DateTime object in the chart category grouping expression by using an expression similar to this: =CDate(Fields!DateValue.Value)

But depending on the actual strings, the CDate() function may fail to convert and you may need to look into using a combination of several VB runtime conversion functions / DateTime functions to achieve the conversion.

-- Robert

|||That's what I feared...thanks for the confirmation. Hopefully something to look forward to in Katmai? [better integration between SSAS and SSRS, that is]|||

Another aproach is to assing a value to your attribute members and use the MemberValue MDX function.

1. In your cube, assign the Value property of the Date attribute hierarchy to a Date column in the underlying table.

2. Unfortunately, the RS SSAS data provider doesn't currently surface the MemberValue function so you need to create a calculated member, e.g. NativeDate with the following expression [Date].[Date].MemberValue.

3. Now you can format the calculated member as you wish, e.g. Format(Fields!NativeDate.Value, "MMM/dd/

|||How does this work with server time dimensions?|||Sorry, it won't b/c you won't be able to assign a value column to a server time dimension.

Monday, March 19, 2012

Formatting dates on a chart when sourced from SSAS2k5

I am creating a few charts in SSRS that are sourced from a cube in AS. On the x-axis is time, which is what I assume a date-like field in the cube. On the y-axis is the measure.

My problem is that I cannot seem to get the dates to format on the chart - regardless of the format code I use, the dates appear in long format, like "Thursday, November 23 2006".

Are the dates from SSAS just string values?

I feel that you may have mentioned some expression or modification done on that field.I faced this problem before where i came to know that Format expression which will be like (#000# Something...) when some operation is being performed on that date. Take out that any operation on that field and give only format option or use format function in the expression.

Hope it should work

Regards,

Raj Deep.A

|||Hi Raj,

I'm not sure I follow - I haven't modified the field at all, yet. I merely created an MDX Query using the designer, and Time is one of the dimensions I used to splice my measure by. I wanted to expose this data in a chart, but for some reason I can't apply any standard formatting codes to the Time label on the x-axis.|||

Based on your query in the MDX query generator, the date time value is provided as a string to Reporting Services. That's why format codes won't work.

You could look into either changing your MDX query to get the value as DateTime object (which means you have to hand-write the MDX) or you could try to convert the string back into a DateTime object in the chart category grouping expression by using an expression similar to this: =CDate(Fields!DateValue.Value)

But depending on the actual strings, the CDate() function may fail to convert and you may need to look into using a combination of several VB runtime conversion functions / DateTime functions to achieve the conversion.

-- Robert

|||That's what I feared...thanks for the confirmation. Hopefully something to look forward to in Katmai? [better integration between SSAS and SSRS, that is]|||

Another aproach is to assing a value to your attribute members and use the MemberValue MDX function.

1. In your cube, assign the Value property of the Date attribute hierarchy to a Date column in the underlying table.

2. Unfortunately, the RS SSAS data provider doesn't currently surface the MemberValue function so you need to create a calculated member, e.g. NativeDate with the following expression [Date].[Date].MemberValue.

3. Now you can format the calculated member as you wish, e.g. Format(Fields!NativeDate.Value, "MMM/dd/

|||How does this work with server time dimensions?|||Sorry, it won't b/c you won't be able to assign a value column to a server time dimension.

Friday, March 9, 2012

Formating Dates

In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
would like to display the date as 9/05, 10/05, etc, is it possible?
Thanks,
JimmyTry the value in the format tab if the list provides the format select it .
otherwise try giving dd/mm in the text box of the format tab.
Amarnath
"jcl_tw" wrote:
> In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> would like to display the date as 9/05, 10/05, etc, is it possible?
> Thanks,
> Jimmy|||Amarnath,
Tried using "mm/yy" in the Format Code field. The date shows up as 00/05
for all the months.
Jimmy
"Amarnath" wrote:
> Try the value in the format tab if the list provides the format select it .
> otherwise try giving dd/mm in the text box of the format tab.
> Amarnath
> "jcl_tw" wrote:
> > In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> > would like to display the date as 9/05, 10/05, etc, is it possible?
> >
> > Thanks,
> > Jimmy|||Try using instr function to seperate the mm/yy ofcourse use date to string
convertion.
Amarnath
"jcl_tw" wrote:
> Amarnath,
> Tried using "mm/yy" in the Format Code field. The date shows up as 00/05
> for all the months.
> Jimmy
> "Amarnath" wrote:
> > Try the value in the format tab if the list provides the format select it .
> > otherwise try giving dd/mm in the text box of the format tab.
> >
> > Amarnath
> >
> > "jcl_tw" wrote:
> >
> > > In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> > > would like to display the date as 9/05, 10/05, etc, is it possible?
> > >
> > > Thanks,
> > > Jimmy|||Jimmy,
Why dont you try this
=Format(DatePart("D",Fields!Date.Value),"#0") & "\" &
Format(Datepart("M",Fields!Date.Value),"#0")
jcl_tw wrote:
> Amarnath,
> Tried using "mm/yy" in the Format Code field. The date shows up as 00/05
> for all the months.
> Jimmy
> "Amarnath" wrote:
> > Try the value in the format tab if the list provides the format select it .
> > otherwise try giving dd/mm in the text box of the format tab.
> >
> > Amarnath
> >
> > "jcl_tw" wrote:
> >
> > > In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> > > would like to display the date as 9/05, 10/05, etc, is it possible?
> > >
> > > Thanks,
> > > Jimmy|||RajDeep,
Try your solution but unfortunately, the "Format Code" field under "Show
Labels" in the chart doesn't allows that many characters.
Jimmy
"RajDeep" wrote:
> Jimmy,
> Why dont you try this
> =Format(DatePart("D",Fields!Date.Value),"#0") & "\" &
> Format(Datepart("M",Fields!Date.Value),"#0")
> jcl_tw wrote:
> > Amarnath,
> >
> > Tried using "mm/yy" in the Format Code field. The date shows up as 00/05
> > for all the months.
> >
> > Jimmy
> >
> > "Amarnath" wrote:
> >
> > > Try the value in the format tab if the list provides the format select it .
> > > otherwise try giving dd/mm in the text box of the format tab.
> > >
> > > Amarnath
> > >
> > > "jcl_tw" wrote:
> > >
> > > > In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> > > > would like to display the date as 9/05, 10/05, etc, is it possible?
> > > >
> > > > Thanks,
> > > > Jimmy
>|||use MM/yy
mm refers to minutes, MM to month.
jcl_tw wrote:
> RajDeep,
> Try your solution but unfortunately, the "Format Code" field under "Show
> Labels" in the chart doesn't allows that many characters.
> Jimmy
> "RajDeep" wrote:
> > Jimmy,
> >
> > Why dont you try this
> >
> > =Format(DatePart("D",Fields!Date.Value),"#0") & "\" &
> > Format(Datepart("M",Fields!Date.Value),"#0")
> >
> > jcl_tw wrote:
> > > Amarnath,
> > >
> > > Tried using "mm/yy" in the Format Code field. The date shows up as 00/05
> > > for all the months.
> > >
> > > Jimmy
> > >
> > > "Amarnath" wrote:
> > >
> > > > Try the value in the format tab if the list provides the format select it .
> > > > otherwise try giving dd/mm in the text box of the format tab.
> > > >
> > > > Amarnath
> > > >
> > > > "jcl_tw" wrote:
> > > >
> > > > > In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> > > > > would like to display the date as 9/05, 10/05, etc, is it possible?
> > > > >
> > > > > Thanks,
> > > > > Jimmy
> >
> >|||Jen,
It works!
Thanks,
Jimmy
"Jen" wrote:
> use MM/yy
> mm refers to minutes, MM to month.
> jcl_tw wrote:
> > RajDeep,
> >
> > Try your solution but unfortunately, the "Format Code" field under "Show
> > Labels" in the chart doesn't allows that many characters.
> >
> > Jimmy
> >
> > "RajDeep" wrote:
> >
> > > Jimmy,
> > >
> > > Why dont you try this
> > >
> > > =Format(DatePart("D",Fields!Date.Value),"#0") & "\" &
> > > Format(Datepart("M",Fields!Date.Value),"#0")
> > >
> > > jcl_tw wrote:
> > > > Amarnath,
> > > >
> > > > Tried using "mm/yy" in the Format Code field. The date shows up as 00/05
> > > > for all the months.
> > > >
> > > > Jimmy
> > > >
> > > > "Amarnath" wrote:
> > > >
> > > > > Try the value in the format tab if the list provides the format select it .
> > > > > otherwise try giving dd/mm in the text box of the format tab.
> > > > >
> > > > > Amarnath
> > > > >
> > > > > "jcl_tw" wrote:
> > > > >
> > > > > > In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> > > > > > would like to display the date as 9/05, 10/05, etc, is it possible?
> > > > > >
> > > > > > Thanks,
> > > > > > Jimmy
> > >
> > >
>|||you dont need to mention anything in the format code,for value you will
have Fields!Date.Value and under that if you can see some thing like
label,write the expression posted there.
even though you got the solution ,it will be useful when it is
important
Regards
Raj Deep.A
jcl_tw wrote:
> RajDeep,
> Try your solution but unfortunately, the "Format Code" field under "Show
> Labels" in the chart doesn't allows that many characters.
> Jimmy
> "RajDeep" wrote:
> > Jimmy,
> >
> > Why dont you try this
> >
> > =Format(DatePart("D",Fields!Date.Value),"#0") & "\" &
> > Format(Datepart("M",Fields!Date.Value),"#0")
> >
> > jcl_tw wrote:
> > > Amarnath,
> > >
> > > Tried using "mm/yy" in the Format Code field. The date shows up as 00/05
> > > for all the months.
> > >
> > > Jimmy
> > >
> > > "Amarnath" wrote:
> > >
> > > > Try the value in the format tab if the list provides the format select it .
> > > > otherwise try giving dd/mm in the text box of the format tab.
> > > >
> > > > Amarnath
> > > >
> > > > "jcl_tw" wrote:
> > > >
> > > > > In my chart report, my x-axis date is displaying as 9/1/05, 10/1/05, etc. I
> > > > > would like to display the date as 9/05, 10/05, etc, is it possible?
> > > > >
> > > > > Thanks,
> > > > > Jimmy
> >
> >

Friday, February 24, 2012

Format DateTime for Scatter Chart

I am making a scatter chart (not using Dundas) to plot at what time (Y-axis) and what date (X-axis) something happened. The DateTime value is coming from a database. I currently have it working if I use the Hour() for the Y-axis, and the DateValue() for the X-axis.

What I'd like to do is make it so that on the Y-axis, I can display the standard time format (i.e. 7:30am), and on the X-axis, display just the date (6/28/2007) rather then the date with midnight on it.

Thanks.

Try using =FormatDateTime()

Larry

Format DateTime for Scatter Chart

I am making a scatter chart (not using Dundas) to plot at what time (Y-axis) and what date (X-axis) something happened. The DateTime value is coming from a database. I currently have it working if I use the Hour() for the Y-axis, and the DateValue() for the X-axis.

What I'd like to do is make it so that on the Y-axis, I can display the standard time format (i.e. 7:30am), and on the X-axis, display just the date (6/28/2007) rather then the date with midnight on it.

Thanks.

Try using =FormatDateTime()

Larry

Sunday, February 19, 2012

format a date in a chart

I have a line graph that has a date label for the X-axis. The date labels
show as this ugly formated date, something like 12/15/2005 11:37:00 AM. Is
there any way to format the X-label so that it will only show the 12/15/2005?
Thanks.In Studio: Chart Properties>X Axis>Format code: d
or in XML:
<CategoryAxis>
<Axis>
<Style>
<Format>d</Format>
"Leon Chuck Gosslin" <Leon Chuck Gosslin@.discussions.microsoft.com> wrote in
message news:B18F0C63-6C8C-42C3-932B-A3FDEDBEB23E@.microsoft.com...
>I have a line graph that has a date label for the X-axis. The date labels
> show as this ugly formated date, something like 12/15/2005 11:37:00 AM.
> Is
> there any way to format the X-label so that it will only show the
> 12/15/2005?
> Thanks.
>