Showing posts with label values. Show all posts
Showing posts with label values. Show all posts

Thursday, March 22, 2012

Check if primary key exists

Hi!

I have created a formview which I among other things uses to insert new values into a database. What I want to check is if the primary key which is put into the form already exists in the db. If it is I want to get a message to my web page, if not the data can be inserted.

How can I do this?

And if the only way to control this is to create a stored procedure. How do I write such a proc?

If you attempt to insert a duplicate value into a PK field, an exception will be thrown. Why not set it to auto-increment and avoid all of this?

HTH,
Ryan

Tuesday, March 20, 2012

Check for Null values in Transact Sql

I am using Visual Web Developer Express 2005 and SQL Server Express 2005.

I have set up a trigger that fires when an update has been performed on
a specific table. The trigger checks to see if specific columns have
been updated. If they have, then the trigger code is executed. This part
works fine.

I am now trying to find a way to check if null values exist in either
one of two field from the same table. If either field contains a null
value, then I don't want the trigger code to be executed.

How can I check for null values and skip a block of code within my
Transact Sql trigger.

Thanks....

You can use the IS NULL clause to test a column...

|||

Use something like:

if exists (select * from MyTbl where Col1 is null or Col2 is null)

//do not update

else //update

Monday, March 19, 2012

Check for Duplicates Help

I have a table that has an ssn column that is nullable. I want to allow duplicate null values but if someone tries to insert or update th column with a value that is not null I need to check to see if the value already exists and if so generate an error.

Can anyone tell or better yet provide an example of the best way to do this. I'm guessing a trigger but I'm pretty green when it comes to writing efficient triggers.

Thanx in advance!!!You can not use unique index but trigger will be good for your case:

drop table test
go
create table test(ssn varchar(7))
go
alter trigger no_duplicates on test
for insert,update
as
if exists(select ssn from test
where ssn in(select ssn from inserted)
and ssn is not null
group by ssn having count(*)>1)begin
raiserror('duplicates!!!',0,1)
rollback tran
end|||Thanks a bunch snail!!!|||No kidding?

DB2 has something SQL Server doesn't?

UNIQUE WHERE NOT NULL

Nothing like that here?

I'm shocked!|||that's an extension for fat ibm dba's

Check for Duplicate values in Access

Hi, I'm creating a database that needs to check a value in a text field =
=
called JobCreate in a form called frmJobCreated against a table called =
tblJobCreated which has a whole list of job numbers in a field called =
JobNo, then come back with a message telling the user if there is a =
duplicate value...any help would be greatly appreciated,,thanks, FraserPlease, post DDL, sample data, and specify expected results.
Are you trying to report duplicate values, prevent them from being inserted
or what?
ML|||Hi, sorry for my ignorance but I'm quite new at databases what is DDL?
I'm trying to tell the user that a job number is already created if they
enter a duplicate number in the form that is already held in another
table, so it will display a message box telling them this, thanks
*** Sent via Developersdex http://www.examnotes.net ***|||Hi
First of all, This is not the right forum because there is a dedicated forum
for access.
well. Use primary key (SOME THING LIKE SELECT COLUMN WHILE DESIGININGG AND
RIGHT CLICK SELECT PRIMARY KEY) in access on the column so that it will
prevent and throws an error. you can customise your error using VBA.
You have to use VBA because you are not using SQL SERVER 2000
Regards
R.D
--Knowledge gets doubled when shared
"Fraser Hetherington" wrote:

> Hi, sorry for my ignorance but I'm quite new at databases what is DDL?
> I'm trying to tell the user that a job number is already created if they
> enter a duplicate number in the form that is already held in another
> table, so it will display a message box telling them this, thanks
> *** Sent via Developersdex http://www.examnotes.net ***
>|||Why are you making your users think of unique values? Why would any user car
e
what number his job is given?
Use a column constraint and design a function that will automatically
generate unique values for the job column. You sound like a crappy ISP -
designed to serve millions of users, yet each of them must create his/her ow
n
*globally unique* username in order to create a valid account. A total waste
of time.
ML|||"Fraser" <fraser68@.tiscali.co.uk> wrote in message
news:op.sy2fmed6s8gdz1@.acer64...
Hi, I'm creating a database that needs to check a value in a text
field
called JobCreate in a form called frmJobCreated against a table called
tblJobCreated which has a whole list of job numbers in a field called
JobNo, then come back with a message telling the user if there is a
duplicate value...any help would be greatly appreciated,,thanks,
Fraser
Fraser,
Pleaes try reposting your above message in *one* of the following
newsgroups:
comp.databases.ms-access
microsoft.public.access.forms
microsoft.public.access.formscoding
Sincerely,
Chris O.

Check database samples for zero or null values

I have a program that writes a sample to a database (Table A) every minute.
I like to put together a script that would check the Table to see if last 5
minutes that were sampled were not 0 or NULL. If the samples were 0 or NULL
then send alert to the RSTK.com email account.
Table A
Sample_Time datetime
Sample_Value int
Please help me complete this task.
Thanks,are you wanted to get an email based on system counters? If so you can use
SQL Server Agent Alerts to achieve this. If you are not using system
counters then you can set up a dts package to acheive this, or stored
procedure etc, and run it through a job.
Simon Worth
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:94068EE3-CBD9-4908-BFD6-5BA16C182D3E@.microsoft.com...
> I have a program that writes a sample to a database (Table A) every
minute.
> I like to put together a script that would check the Table to see if last
5
> minutes that were sampled were not 0 or NULL. If the samples were 0 or
NULL
> then send alert to the RSTK.com email account.
> Table A
> Sample_Time datetime
> Sample_Value int
> Please help me complete this task.
> Thanks,
>
>
>
>
>
>|||In principle, like this:
IF
(SELECT *
FROM TableA
WHERE sample_time
BETWEEN DATEADD(MI,-5,CURRENT_TIMESTAMP)
AND CURRENT_TIMESTAMP
AND COALESCE(sample_value,0) = 0)
EXEC usp_sendmail
@.recipients = 'foo@.bar.com',
@.message = 'Blah, blah',
..
However, I recommend you send mail from an application process rather
than from SQL Server.
David Portas
SQL Server MVP
--|||Set up SQL Server for email integration with. Create a job with a t-sql
task.
if exists ( select 1 from tablea where sampletime > dateadd(mi,-5,getdate())
and (Sample_value is null or Sample_value = 0))
xp_sendmail yada yada (
details of xp_sendmail in SQL BOL..
Schedule the job every 5 minutes.
You might wish to use Gert Drapers sqlmail ( www.sqldev.net) instead of
using MS mail integration...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:94068EE3-CBD9-4908-BFD6-5BA16C182D3E@.microsoft.com...
> I have a program that writes a sample to a database (Table A) every
> minute.
> I like to put together a script that would check the Table to see if last
> 5
> minutes that were sampled were not 0 or NULL. If the samples were 0 or
> NULL
> then send alert to the RSTK.com email account.
> Table A
> Sample_Time datetime
> Sample_Value int
> Please help me complete this task.
> Thanks,
>
>
>
>
>
>

Sunday, March 11, 2012

Check constraint SQL Server 2005

I want to set up a simple check constraint on a column limiting to values "Yes", "No" and ""

I'm trying to use:

CONSTRAINT IsAccessToItRestricted_ck

check (IsAccessToItRestricted in('Yes,'No','');

but this is not the right syntax........... help!

([ColumnName]='Yes' OR [ColumnName]='No' OR [ColumnName]='')

here's your answer

Thursday, March 8, 2012

Check constraint

I am new to SQL Server, so I'm not quite sure how to use this feature. I need to limit a field to only accept a set of three values: H, Q, and C. I know how to do this in a native Access table. I'm not quite sure how to do this in SQL Server. I assum
e this is what a check constraint is, but I don't know how to set one up or where to implement it.
Any suggestions would be greatly appreciated,
Crystal
Yep, it's a check constraint:
create table MyTable
(
PK int primary key
, MyCol char (1) not null constraint CK_MyTable (MyCol in ('H', 'Q',
'C'))
)
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
..
"Crystal" <anonymous@.discussions.microsoft.com> wrote in message
news:BC380E12-BD25-4308-8860-08617207DEE4@.microsoft.com...
I am new to SQL Server, so I'm not quite sure how to use this feature. I
need to limit a field to only accept a set of three values: H, Q, and C. I
know how to do this in a native Access table. I'm not quite sure how to do
this in SQL Server. I assume this is what a check constraint is, but I
don't know how to set one up or where to implement it.
Any suggestions would be greatly appreciated,
Crystal
|||Try this -
create table test (
iintidentity
, jchar(1)
check (j in ('H', 'Q', 'C'))
)
|||Ok. This is what is going to make me look like a dork. . .
Now that I have the syntax. . . where do I put it to create the check constraint?
Crystal
|||The syntax I showed you is to create the constraint at the time you create
the table. However, if the table already exists, you can do an ALTER TABLE:
alter table MyTable
add
constraint CK_MyTable (MyCol in ('H', 'Q', 'C'))
go
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Crystal" <anonymous@.discussions.microsoft.com> wrote in message
news:CFC4AF0F-052F-442A-8037-307EC3A3D437@.microsoft.com...
Ok. This is what is going to make me look like a dork. . .
Now that I have the syntax. . . where do I put it to create the check
constraint?
Crystal

Check constraint

I am new to SQL Server, so I'm not quite sure how to use this feature. I need to limit a field to only accept a set of three values: H, Q, and C. I know how to do this in a native Access table. I'm not quite sure how to do this in SQL Server. I assume this is what a check constraint is, but I don't know how to set one up or where to implement it
Any suggestions would be greatly appreciated
CrystalThis is a multi-part message in MIME format.
--=_NextPart_000_012E_01C42099.51AAF520
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
Yep, it's a check constraint:
create table MyTable
(
PK int primary key
, MyCol char (1) not null constraint CK_MyTable (MyCol in ('H', 'Q',
'C'))
)
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
.
"Crystal" <anonymous@.discussions.microsoft.com> wrote in message
news:BC380E12-BD25-4308-8860-08617207DEE4@.microsoft.com...
I am new to SQL Server, so I'm not quite sure how to use this feature. I
need to limit a field to only accept a set of three values: H, Q, and C. I
know how to do this in a native Access table. I'm not quite sure how to do
this in SQL Server. I assume this is what a check constraint is, but I
don't know how to set one up or where to implement it.
Any suggestions would be greatly appreciated,
Crystal
--=_NextPart_000_012E_01C42099.51AAF520
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Yep, it's a check =constraint:
create table =MyTable
(
PK int primary =key
, =MyCol char (1) not null constraint CK_MyTable (MyCol in =('H', 'Q', 'C'))
)
-- Tom
----Thomas A. =Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql.
"Crystal" wrote in message news:BC3=80E12-BD25-4308-8860-08617207DEE4@.microsoft.com...I am new to SQL Server, so I'm not quite sure how to use this =feature. I need to limit a field to only accept a set of three values: H, Q, =and C. I know how to do this in a native Access table. I'm not =quite sure how to do this in SQL Server. I assume this is what a check constraint is, but I don't know how to set one up or where to implement it.Any suggestions would be greatly appreciated,Crystal

--=_NextPart_000_012E_01C42099.51AAF520--|||Ok. This is what is going to make me look like a dork. .
Now that I have the syntax. . . where do I put it to create the check constraint
Crystal|||This is a multi-part message in MIME format.
--=_NextPart_000_0086_01C42136.B95D8140
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
The syntax I showed you is to create the constraint at the time you create
the table. However, if the table already exists, you can do an ALTER TABLE:
alter table MyTable
add
constraint CK_MyTable (MyCol in ('H', 'Q', 'C'))
go
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Crystal" <anonymous@.discussions.microsoft.com> wrote in message
news:CFC4AF0F-052F-442A-8037-307EC3A3D437@.microsoft.com...
Ok. This is what is going to make me look like a dork. . .
Now that I have the syntax. . . where do I put it to create the check
constraint?
Crystal
--=_NextPart_000_0086_01C42136.B95D8140
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

The syntax I showed you is to create =the constraint at the time you create the table. However, if the table =already exists, you can do an ALTER TABLE:
alter table =MyTable
add
=constraint CK_MyTable (MyCol in ('H', 'Q', 'C'))
go
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Crystal" wrote in message news:CFC=4AF0F-052F-442A-8037-307EC3A3D437@.microsoft.com...Ok. This is what is going to make me look like a dork. . .Now that I =have the syntax. . . where do I put it to create the check constraint?Crystal

--=_NextPart_000_0086_01C42136.B95D8140--

Check Constraint

In our database we have an indexed field that is using unique values, so in the index we turned on the unique property. Now with some changes we made in the application this value can be Null (could not be Null in the past). When we have more as 1 value having value Null we get an exception of unique key violation.

Therefor we want to make an check constraint the checks if the value allready exists when the value is not Null.

Is this possible and how can it be done?

You're going to need to use a trigger to check the values in the way you described.|||Hi,

I'm getting the same error.
When I try to add a new user I receive this errror:

ystem.Data.ConstraintException: Column 'User ID' is constrained to be unique. Value '{37525b24-d982-470d-9d1c-e3b3c7536958}' is already present.
at System.Data.UniqueConstraint.CheckConstraint(DataRow row, DataRowAction action)
at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)

Unfortunately I have only one entry on my db with this User ID value. Moreover I have try to delete all my users with BU.
Can anybody help me?

Thanks a lot,

F.T

Check constraint

I am new to SQL Server, so I'm not quite sure how to use this feature. I ne
ed to limit a field to only accept a set of three values: H, Q, and C. I k
now how to do this in a native Access table. I'm not quite sure how to do t
his in SQL Server. I assum
e this is what a check constraint is, but I don't know how to set one up or
where to implement it.
Any suggestions would be greatly appreciated,
CrystalYep, it's a check constraint:
create table MyTable
(
PK int primary key
, MyCol char (1) not null constraint CK_MyTable (MyCol in ('H', 'Q',
'C'))
)
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
.
"Crystal" <anonymous@.discussions.microsoft.com> wrote in message
news:BC380E12-BD25-4308-8860-08617207DEE4@.microsoft.com...
I am new to SQL Server, so I'm not quite sure how to use this feature. I
need to limit a field to only accept a set of three values: H, Q, and C. I
know how to do this in a native Access table. I'm not quite sure how to do
this in SQL Server. I assume this is what a check constraint is, but I
don't know how to set one up or where to implement it.
Any suggestions would be greatly appreciated,
Crystal|||Try this -
create table test (
i int identity
, j char(1)
check (j in ('H', 'Q', 'C'))
)|||Ok. This is what is going to make me look like a dork. . .
Now that I have the syntax. . . where do I put it to create the check constr
aint?
Crystal|||The syntax I showed you is to create the constraint at the time you create
the table. However, if the table already exists, you can do an ALTER TABLE:
alter table MyTable
add
constraint CK_MyTable (MyCol in ('H', 'Q', 'C'))
go
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Crystal" <anonymous@.discussions.microsoft.com> wrote in message
news:CFC4AF0F-052F-442A-8037-307EC3A3D437@.microsoft.com...
Ok. This is what is going to make me look like a dork. . .
Now that I have the syntax. . . where do I put it to create the check
constraint?
Crystal

Wednesday, March 7, 2012

chart-simple line x-axis

How is it possible to have the values on the chart x-axis to be shown vertically rather than horizantal?
Thanks

I dont find any option to do that. actually coming to real time when the number of values on x axis is more,the values will be shown vertically.

Is that acceptable? or you want your values all the time printed vertically

Thank you,

Raj Deep.A

|||

I just tested your comments.

You are right.

I think I will go with the default for now.

Many thanks

Charts: Using Top N but need to show 'Others' as one

Hi all
I'm generating a column chart, lets say its CustomerID as a category
and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
might give 100 column bars so we filter the category to show, say, Top
20.
Can anyone see a way, convoluted or otherwise, of creating one more
column bar to represent SUM(Sales.Value) for the other 80.
I just want to be sure that I'm not missing something before I dive
into writing code that creates a temporary table to report on which is
the only way I can see.
Cheers
RossAFAIK there is no function for "others". Perhaps you can do this on your
query and then flush the result to the report. Raise your hand if you need
assitance with this.
HTH, Jens Süßmeyer
--
http://www.sqlserver2005.de
--
"Ross" <synergy56@.hotmail.com> schrieb im Newsbeitrag
news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> Hi all
> I'm generating a column chart, lets say its CustomerID as a category
> and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> might give 100 column bars so we filter the category to show, say, Top
> 20.
> Can anyone see a way, convoluted or otherwise, of creating one more
> column bar to represent SUM(Sales.Value) for the other 80.
> I just want to be sure that I'm not missing something before I dive
> into writing code that creates a temporary table to report on which is
> the only way I can see.
> Cheers
> Ross
>|||Use two queries and union them together. The first query is your top 10.
The second query uses the first query as a subquery to return anly keys,
then do a NOT IN() against the key selection. This will return all but the
top 10 which you can aggregate into a single valued called "Other"
Basing your your chart on the union of these two queries will give you 11
data points; top 10 and other.
Paul Turley
"Ross" <synergy56@.hotmail.com> wrote in message
news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> Hi all
> I'm generating a column chart, lets say its CustomerID as a category
> and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> might give 100 column bars so we filter the category to show, say, Top
> 20.
> Can anyone see a way, convoluted or otherwise, of creating one more
> column bar to represent SUM(Sales.Value) for the other 80.
> I just want to be sure that I'm not missing something before I dive
> into writing code that creates a temporary table to report on which is
> the only way I can see.
> Cheers
> Ross
>|||I did try that, however i'm storing my 'N' for the top N in a parameter, and
i see no way to use a parameter in a query to limit the rows. Likewise i see
no way to add a ranking number in the table itself. anybody?
"Paul Turley" wrote:
> Use two queries and union them together. The first query is your top 10.
> The second query uses the first query as a subquery to return anly keys,
> then do a NOT IN() against the key selection. This will return all but the
> top 10 which you can aggregate into a single valued called "Other"
> Basing your your chart on the union of these two queries will give you 11
> data points; top 10 and other.
> Paul Turley
>
> "Ross" <synergy56@.hotmail.com> wrote in message
> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> > Hi all
> >
> > I'm generating a column chart, lets say its CustomerID as a category
> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> > might give 100 column bars so we filter the category to show, say, Top
> > 20.
> >
> > Can anyone see a way, convoluted or otherwise, of creating one more
> > column bar to represent SUM(Sales.Value) for the other 80.
> >
> > I just want to be sure that I'm not missing something before I dive
> > into writing code that creates a temporary table to report on which is
> > the only way I can see.
> >
> > Cheers
> > Ross
> >
>
>|||You can define a dynamic TopN filter like this:
Filter expression: = Fields!A.Value
Filter operator: TopN
Filter value: = Parameters!Top.Value
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
>I did try that, however i'm storing my 'N' for the top N in a parameter,
>and
> i see no way to use a parameter in a query to limit the rows. Likewise i
> see
> no way to add a ranking number in the table itself. anybody?
>
> "Paul Turley" wrote:
>> Use two queries and union them together. The first query is your top 10.
>> The second query uses the first query as a subquery to return anly keys,
>> then do a NOT IN() against the key selection. This will return all but
>> the
>> top 10 which you can aggregate into a single valued called "Other"
>> Basing your your chart on the union of these two queries will give you 11
>> data points; top 10 and other.
>> Paul Turley
>>
>> "Ross" <synergy56@.hotmail.com> wrote in message
>> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
>> > Hi all
>> >
>> > I'm generating a column chart, lets say its CustomerID as a category
>> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
>> > might give 100 column bars so we filter the category to show, say, Top
>> > 20.
>> >
>> > Can anyone see a way, convoluted or otherwise, of creating one more
>> > column bar to represent SUM(Sales.Value) for the other 80.
>> >
>> > I just want to be sure that I'm not missing something before I dive
>> > into writing code that creates a temporary table to report on which is
>> > the only way I can see.
>> >
>> > Cheers
>> > Ross
>> >
>>|||Ard,
You can use paramters and variables with the SET ROWCOUNT command. You
could also build a string containing your TOP N query and execute dynamic
SQL, but this is not my preference.
Ted
"Ard Goossens" wrote:
> I did try that, however i'm storing my 'N' for the top N in a parameter, and
> i see no way to use a parameter in a query to limit the rows. Likewise i see
> no way to add a ranking number in the table itself. anybody?
> "Paul Turley" wrote:
> > Use two queries and union them together. The first query is your top 10.
> > The second query uses the first query as a subquery to return anly keys,
> > then do a NOT IN() against the key selection. This will return all but the
> > top 10 which you can aggregate into a single valued called "Other"
> >
> > Basing your your chart on the union of these two queries will give you 11
> > data points; top 10 and other.|||Robert
Do you know by any chance how to handle the cases when Top is null? Let's
say you want to give the users the option to select a Top N value or to leave
it null. Thx
"Robert Bruckner [MSFT]" wrote:
> You can define a dynamic TopN filter like this:
> Filter expression: = Fields!A.Value
> Filter operator: TopN
> Filter value: = Parameters!Top.Value
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
> news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
> >I did try that, however i'm storing my 'N' for the top N in a parameter,
> >and
> > i see no way to use a parameter in a query to limit the rows. Likewise i
> > see
> > no way to add a ranking number in the table itself. anybody?
> >
> >
> >
> > "Paul Turley" wrote:
> >
> >> Use two queries and union them together. The first query is your top 10.
> >> The second query uses the first query as a subquery to return anly keys,
> >> then do a NOT IN() against the key selection. This will return all but
> >> the
> >> top 10 which you can aggregate into a single valued called "Other"
> >>
> >> Basing your your chart on the union of these two queries will give you 11
> >> data points; top 10 and other.
> >>
> >> Paul Turley
> >>
> >>
> >> "Ross" <synergy56@.hotmail.com> wrote in message
> >> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> >> > Hi all
> >> >
> >> > I'm generating a column chart, lets say its CustomerID as a category
> >> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC. That
> >> > might give 100 column bars so we filter the category to show, say, Top
> >> > 20.
> >> >
> >> > Can anyone see a way, convoluted or otherwise, of creating one more
> >> > column bar to represent SUM(Sales.Value) for the other 80.
> >> >
> >> > I just want to be sure that I'm not missing something before I dive
> >> > into writing code that creates a temporary table to report on which is
> >> > the only way I can see.
> >> >
> >> > Cheers
> >> > Ross
> >> >
> >>
> >>
> >>
>
>|||There are two different approaches how to deal with this situation:
1. "Fake Parameter" approach:
* Create a "fake" hidden (non-prompted) parameter PSize to calculate the
dataset size. I.e. the parameter default value would be
=CountRows("ChartDataSetName")
* on the chart, the filter expression would look like this:
Filter expression: = Fields!A.Value
Filter operator: TopN
Filter value: = iif( Parameters!Top.Value is Nothing,
Parameters!PSize.Value, Parameters!Top.Value)
2. "Filter with Duplicates" approach:
Filter expression: = iif( Parameters!Top.Value is Nothing, 1,
Fields!A.Value)
Filter operator: TopN
Filter value: = iif( Parameters!Top.Value is Nothing, 1,
Parameters!Top.Value)
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marco" <Marco@.discussions.microsoft.com> wrote in message
news:19869577-684A-4971-A89E-DCA199EC5141@.microsoft.com...
> Robert
> Do you know by any chance how to handle the cases when Top is null? Let's
> say you want to give the users the option to select a Top N value or to
> leave
> it null. Thx
> "Robert Bruckner [MSFT]" wrote:
>> You can define a dynamic TopN filter like this:
>> Filter expression: = Fields!A.Value
>> Filter operator: TopN
>> Filter value: = Parameters!Top.Value
>>
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
>> news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
>> >I did try that, however i'm storing my 'N' for the top N in a parameter,
>> >and
>> > i see no way to use a parameter in a query to limit the rows. Likewise
>> > i
>> > see
>> > no way to add a ranking number in the table itself. anybody?
>> >
>> >
>> >
>> > "Paul Turley" wrote:
>> >
>> >> Use two queries and union them together. The first query is your top
>> >> 10.
>> >> The second query uses the first query as a subquery to return anly
>> >> keys,
>> >> then do a NOT IN() against the key selection. This will return all but
>> >> the
>> >> top 10 which you can aggregate into a single valued called "Other"
>> >>
>> >> Basing your your chart on the union of these two queries will give you
>> >> 11
>> >> data points; top 10 and other.
>> >>
>> >> Paul Turley
>> >>
>> >>
>> >> "Ross" <synergy56@.hotmail.com> wrote in message
>> >> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
>> >> > Hi all
>> >> >
>> >> > I'm generating a column chart, lets say its CustomerID as a category
>> >> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC.
>> >> > That
>> >> > might give 100 column bars so we filter the category to show, say,
>> >> > Top
>> >> > 20.
>> >> >
>> >> > Can anyone see a way, convoluted or otherwise, of creating one more
>> >> > column bar to represent SUM(Sales.Value) for the other 80.
>> >> >
>> >> > I just want to be sure that I'm not missing something before I dive
>> >> > into writing code that creates a temporary table to report on which
>> >> > is
>> >> > the only way I can see.
>> >> >
>> >> > Cheers
>> >> > Ross
>> >> >
>> >>
>> >>
>> >>
>>|||Thanks Robert this is very helpful
"Robert Bruckner [MSFT]" wrote:
> There are two different approaches how to deal with this situation:
> 1. "Fake Parameter" approach:
> * Create a "fake" hidden (non-prompted) parameter PSize to calculate the
> dataset size. I.e. the parameter default value would be
> =CountRows("ChartDataSetName")
> * on the chart, the filter expression would look like this:
> Filter expression: = Fields!A.Value
> Filter operator: TopN
> Filter value: = iif( Parameters!Top.Value is Nothing,
> Parameters!PSize.Value, Parameters!Top.Value)
> 2. "Filter with Duplicates" approach:
> Filter expression: = iif( Parameters!Top.Value is Nothing, 1,
> Fields!A.Value)
> Filter operator: TopN
> Filter value: = iif( Parameters!Top.Value is Nothing, 1,
> Parameters!Top.Value)
>
> --
> Robert M. Bruckner
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Marco" <Marco@.discussions.microsoft.com> wrote in message
> news:19869577-684A-4971-A89E-DCA199EC5141@.microsoft.com...
> > Robert
> >
> > Do you know by any chance how to handle the cases when Top is null? Let's
> > say you want to give the users the option to select a Top N value or to
> > leave
> > it null. Thx
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> >> You can define a dynamic TopN filter like this:
> >> Filter expression: = Fields!A.Value
> >> Filter operator: TopN
> >> Filter value: = Parameters!Top.Value
> >>
> >>
> >> -- Robert
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >> "Ard Goossens" <ArdGoossens@.discussions.microsoft.com> wrote in message
> >> news:CE512986-BE7C-4189-BC4B-70165DE734F2@.microsoft.com...
> >> >I did try that, however i'm storing my 'N' for the top N in a parameter,
> >> >and
> >> > i see no way to use a parameter in a query to limit the rows. Likewise
> >> > i
> >> > see
> >> > no way to add a ranking number in the table itself. anybody?
> >> >
> >> >
> >> >
> >> > "Paul Turley" wrote:
> >> >
> >> >> Use two queries and union them together. The first query is your top
> >> >> 10.
> >> >> The second query uses the first query as a subquery to return anly
> >> >> keys,
> >> >> then do a NOT IN() against the key selection. This will return all but
> >> >> the
> >> >> top 10 which you can aggregate into a single valued called "Other"
> >> >>
> >> >> Basing your your chart on the union of these two queries will give you
> >> >> 11
> >> >> data points; top 10 and other.
> >> >>
> >> >> Paul Turley
> >> >>
> >> >>
> >> >> "Ross" <synergy56@.hotmail.com> wrote in message
> >> >> news:6sgt515glf8uvkr8vfqqliv554im1l7pak@.4ax.com...
> >> >> > Hi all
> >> >> >
> >> >> > I'm generating a column chart, lets say its CustomerID as a category
> >> >> > and SUM(Sales.Value) as a values sorted by SUM(Sales.Value) DESC.
> >> >> > That
> >> >> > might give 100 column bars so we filter the category to show, say,
> >> >> > Top
> >> >> > 20.
> >> >> >
> >> >> > Can anyone see a way, convoluted or otherwise, of creating one more
> >> >> > column bar to represent SUM(Sales.Value) for the other 80.
> >> >> >
> >> >> > I just want to be sure that I'm not missing something before I dive
> >> >> > into writing code that creates a temporary table to report on which
> >> >> > is
> >> >> > the only way I can see.
> >> >> >
> >> >> > Cheers
> >> >> > Ross
> >> >> >
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>

Saturday, February 25, 2012

Charting...

I'll be quick and too the point...
1: I have a stacked area chart.
2: Percentages are the values being marked.
Issue:
I need to make the 100 mark (text and line) on the y-axis to be red.
I've tried writing an expression to get at the current "label" for the
mark. I keep getting the following error:
<<
The border color expression for the chart 'Sample' contains an
error: [BC30456] 'value' is not a member of
'ReportExprHostImpl.EH_Sample.EH_ValueAxis'.
>>
Here's what I have: '=iif(me.Value,"Black", "Red")'
I've also tried .Text and .Label.
Any help would be appreciated.I gave you incomplete code. Here is what I currently have.
Here's what I have: '=iif(me.Value <> "100","Black", "Red")'|||Sorry, the color of the axis is not an expression.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stu" <stumiller@.unforgettable.com> wrote in message
news:1104275769.160878.21860@.z14g2000cwz.googlegroups.com...
>I gave you incomplete code. Here is what I currently have.
> Here's what I have: '=iif(me.Value <> "100","Black", "Red")'
>|||Brian Welcker [MS] wrote:
> Sorry, the color of the axis is not an expression.
> --
> Brian Welcker
> Group Program Manager
> Microsoft SQL Server
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Stu" <stumiller@.unforgettable.com> wrote in message
> news:1104275769.160878.21860@.z14g2000cwz.googlegroups.com...
> >I gave you incomplete code. Here is what I currently have.
> > Here's what I have: '=iif(me.Value <> "100","Black", "Red")'
> >
Brian,
Thanks for responding...
So, just to make sure I understand what your saying... there is no way
to get the "value" or "text" of an axis and change the style of that
axis based upon that value?
The reason I "ask" it again this way is that I am able to change the
color of the line and text with this statement:
'=iif(InScope("100"),"Black", "Red")'
Ofcourse, "100" is not within the scope of the data and all the lines
turn "Red" but the point being, I can change the style in the
expression. I'm just asking is there a way to determine what axis your
on.
Thanks|||Yes, lines are data so you can set their color to an expression. Axis values
aren't data so expressions don't really make any sense (we can't iterate
through all possible values). We would have to add an 'Axis value color'
property to the data point.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stu" <stumiller@.unforgettable.com> wrote in message
news:1104349698.883859.301160@.c13g2000cwb.googlegroups.com...
> Brian Welcker [MS] wrote:
>> Sorry, the color of the axis is not an expression.
>> --
>> Brian Welcker
>> Group Program Manager
>> Microsoft SQL Server
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>> "Stu" <stumiller@.unforgettable.com> wrote in message
>> news:1104275769.160878.21860@.z14g2000cwz.googlegroups.com...
>> >I gave you incomplete code. Here is what I currently have.
>> > Here's what I have: '=iif(me.Value <> "100","Black", "Red")'
>> >
> Brian,
> Thanks for responding...
> So, just to make sure I understand what your saying... there is no way
> to get the "value" or "text" of an axis and change the style of that
> axis based upon that value?
> The reason I "ask" it again this way is that I am able to change the
> color of the line and text with this statement:
> '=iif(InScope("100"),"Black", "Red")'
> Ofcourse, "100" is not within the scope of the data and all the lines
> turn "Red" but the point being, I can change the style in the
> expression. I'm just asking is there a way to determine what axis your
> on.
> Thanks
>

Charting simple value over time chart problems.

I am using Visual Studio Academic version 2002.

I have a simple table with dates and values that correspond to those dates and I would like to chart it using crystal reports. I have created a new report and pulled in the 2 columns from the table.

Now I am lost. When ever I try to do a chart it only gives me the option to continue if I select the "show value and select a field". Thats fine and dandy but when I select a field under any chart type or any chart option it always says "Count of <fieldname>" which is totally wrong.

I only want

for each x value show a y value. (basically like a stock ticker)

This is incredibly frustrating since this is the simplest graph type I can imagine and it just completely is not user friendly for it. Any help would be hugely appreciated.

Thank you.Btw, I downloaded the latest version of crystal reports and it does the same thing.

So obviously I just have no clue how to do this type of chart.

The "do not summarize" button is PERMA disabled, so no matter what field I select in the "Show Values" area, they are always Counted instead rather than just showing the value.

I am puting the date field in the "on Change of" column.

and the corresponding value in the "Show value(s)" column, but again in the show value(s) column it always Counts them rather than just displaying the value.

I tried inverting the selection with putting the value field in the "on change of" and the date field in the "show values" column with erradic results.

Can this type of simple graph even be created in crystal??|||Well now I know what the problem is. Called the company and they said that only the advanced developer version of crystal reports gives the functionality to not summarize the selected values with VS.net.

This is also the same case with the downloadable evaluation versions of their software.

Personally that makes me so annoyed I just won't recommend the product as our reporting solution. If I cannot even show my boss a working example of what types of charting and reports we will be getting with the product, there is no way I am going to even try to sell it to them because the software hasn't even sold me.|||After thinking about this, I came to the conclusion that the sales lady I spoke with must have been smoking crack.

I called Crystal again, went through an hour hugabaloo to get to a tech support guy to finally get the real answer.

The "don't summarize field" works with formulas. So that if you want to create a simple x, y graph, you must create a formula to show the value of the y field.

Don't worry you are not really creating a formula and changing the value at all, it is just the stupid interface they have for their 3rd party charting tool. So, you just have to jump through their hoops to get your work done. It is not intuative at all, but it works and luckily it is simple to do.

So

Task 1: create your report,

Task 2: before you add a chart to it, click on the solution explorer and select formula fields. Right click and select -> New

Task 3: Select the field you want to display as the y value from the database connection explorer and double click on it. This will move something like { <field name> } into the textbox at the bottom of the formula form. Leave it like that. Save and close the formula dialog box.

Task 4: Add a chart to your report.
-In the data fields (you should see your new formula field in the data field there with what ever name you named it when you saved it), select your x value (field) in the top list box that has the drop down that says "On Change of".

-Then select the formula field for the bottom list box that says "show value(s)". The don't summarize button now becomes upchecked if you needed it to be, and your chart should display something near correctly at this point.

There you go.|||I've got exactly the same problem. I tried your solution but that doesn't work.. the don't summarize button is still disabled.

I'm using Visual Studio .Net 2003

Do you have any idea why the charts' not working?|||for wwater:
Make sure that you select an item in the Show Values list box, otherwise the "Don't Summarize Values" option will be greyed out. Took me a while to cotton on to how that area works - not very untuitively, as it happens!

And of course "Don't Summarize Values" won't be enabled if the field you have selected is a "Sum of Group xxxx" type field, because you can't un-sum a summing operation.....:-))

Dave|||When I select the formula field (Y) in the Show Value's list box, the "Don't Summarize Values" option is still disabled..
The chart gives always a Y value of 1 for each X value, that is totaly wrong according to the table..|||might pay you to check Crystal Support site re evaluation precedence, because some formulae are evaluated on first poass thru report, and others are done on second pass, and depending what type of formula and where it is (detail vs group) can impact on this.

MOre info on actual formula, whether it's SUM, running total, etc etc, and where it's placed may help.

Dave|||might pay you to check Crystal Support site re evaluation precedence, because some formulae are evaluated on first poass thru report, and others are done on second pass, and depending what type of formula and where it is (detail vs group) can impact on this.

MOre info on actual formula, whether it's SUM, running total, etc etc, and where it's placed may help.

Dave
hey can u help me fix my project in vb.net...please lemme know if u can help ...i would b very thankful if u could help me...please reply soon...
thanks
shruti.|||I found out why charts didn't work. I did not found a direct solution, but i did found a way to work around the problem.

Instead of making a Blank Report, choose the Report Expert and insert the Chart. Then the chart works..

wil.

Charting question

I have a report where each page presents some data in tabular form, the
bottom row (numerically) representing a histogram; i.e., % of values falling
into the "bucket" corresponding to that column. Below this row I'd like to
have a bar chart that graphically displays this histogram with each bar
aligned with the column above. Although I've figured out how to constuct
the chart object there doesn't seem to be any way to actually get things to
line up properly.
The portion of the last row containing the data consists of 7 cells. There
are a couple of padding columns so the first data item is in column 3. What
I tried was to insert a row below (actually a footer row), then merge the 7
cells below the data along with the left adjacent pad cell. I included the
extra cell to allow space for the y axis labels.
So, I can get the chart to appear, but due to the formatting of the chart;
i.e., white space, things don't line up properly. I'm trying to duplicate
(as much as possible) a Crystal generated report in order to determine the
feasibility of using Reporting Services instead. I'm afraid this might be a
deal breaker -- so if anyone has any suggestions I'm anxious to hear back!
Thanks in advance for any help.
BillSo, anybody got any ideas on this one? I'd hoped to get some help before
this scrolls off the edge of the earth...
Bill
"Bill Cohagan" <bill@.teraXNOSPAMXquest.com> wrote in message
news:eDoS$jukEHA.1936@.TK2MSFTNGP12.phx.gbl...
>I have a report where each page presents some data in tabular form, the
> bottom row (numerically) representing a histogram; i.e., % of values
> falling
> into the "bucket" corresponding to that column. Below this row I'd like to
> have a bar chart that graphically displays this histogram with each bar
> aligned with the column above. Although I've figured out how to constuct
> the chart object there doesn't seem to be any way to actually get things
> to
> line up properly.
> The portion of the last row containing the data consists of 7 cells.
> There
> are a couple of padding columns so the first data item is in column 3.
> What
> I tried was to insert a row below (actually a footer row), then merge the
> 7
> cells below the data along with the left adjacent pad cell. I included the
> extra cell to allow space for the y axis labels.
> So, I can get the chart to appear, but due to the formatting of the chart;
> i.e., white space, things don't line up properly. I'm trying to duplicate
> (as much as possible) a Crystal generated report in order to determine the
> feasibility of using Reporting Services instead. I'm afraid this might be
> a
> deal breaker -- so if anyone has any suggestions I'm anxious to hear back!
> Thanks in advance for any help.
> Bill
>

Chart Y-axis Values Problem

I created a chart using some calculated fields, the calculations are working
correctly (I manually checked the math), but the Y axis values are way off.
The highest field value generated was 18,544 but the scale on the chart was
showing 500,000 with the bar reaching nearly to the top. I could understand
if the scale was just off and the bar stopped at the correct position, but
not only is the scale off, the bar doesn't correctly represent the value
either. Because this report will be used for several customers I can't
manually set a limit for the Y-axis. I turned off the labels for the Y-axis
so that I can use the chart, but I would prefer being able to see the labels.
I have installed SP1. Any help would be appreciated.
JoeHi, you can convert the scale of your chart in a expression in the RDL; try
it.
John Bocachica
Colombia
"JHoward" <JHoward@.discussions.microsoft.com> wrote in message
news:78D0BEDF-A212-4B07-9641-9A1615E6168F@.microsoft.com...
>I created a chart using some calculated fields, the calculations are
>working
> correctly (I manually checked the math), but the Y axis values are way
> off.
> The highest field value generated was 18,544 but the scale on the chart
> was
> showing 500,000 with the bar reaching nearly to the top. I could
> understand
> if the scale was just off and the bar stopped at the correct position, but
> not only is the scale off, the bar doesn't correctly represent the value
> either. Because this report will be used for several customers I can't
> manually set a limit for the Y-axis. I turned off the labels for the
> Y-axis
> so that I can use the chart, but I would prefer being able to see the
> labels.
> I have installed SP1. Any help would be appreciated.
> Joe|||Note: expression-based min/max/intervals will only be available on RS2005.
Joe, can you post a simplified report which runs e.g. based on Northwind
data and reproduces the issue?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"John Bocachica (Colombia)" <jbocachica@.gmail.com> wrote in message
news:e%23FQGGl%23EHA.1084@.tk2msftngp13.phx.gbl...
> Hi, you can convert the scale of your chart in a expression in the RDL;
try
> it.
> John Bocachica
> Colombia
> "JHoward" <JHoward@.discussions.microsoft.com> wrote in message
> news:78D0BEDF-A212-4B07-9641-9A1615E6168F@.microsoft.com...
> >I created a chart using some calculated fields, the calculations are
> >working
> > correctly (I manually checked the math), but the Y axis values are way
> > off.
> > The highest field value generated was 18,544 but the scale on the chart
> > was
> > showing 500,000 with the bar reaching nearly to the top. I could
> > understand
> > if the scale was just off and the bar stopped at the correct position,
but
> > not only is the scale off, the bar doesn't correctly represent the value
> > either. Because this report will be used for several customers I can't
> > manually set a limit for the Y-axis. I turned off the labels for the
> > Y-axis
> > so that I can use the chart, but I would prefer being able to see the
> > labels.
> > I have installed SP1. Any help would be appreciated.
> >
> > Joe
>

chart y-axis scales

Hi,
How is it possible to programmatically set the min and max scale values of
the Y-axis in a chart?
Currently I manually enter values in the Y-Axis scale min/max properties.
ThanksJust place the field data into the boxes.
i.e. min(fields.id.value)
"farshad" wrote:
> Hi,
> How is it possible to programmatically set the min and max scale values of
> the Y-axis in a chart?
> Currently I manually enter values in the Y-Axis scale min/max properties.
> Thanks

Chart warning when "time-scaled values" is enabled.

I have a line chart with an x-axis of dates. When I enable "time-scaled
values" on the x-axis of the chart properties, I get this warning and the
chart does not graph the data properly.
"The sorting applied to the category grouping of the chart â'chart2â' is
different from the grouping expression."
If I disable "time-scaled values" the chart graphs the data properly, but
then I see way too many date labels on the x-axis that makes it unreadable.
Does anyone know how to resolve the above warning and still get the same
readability on the x-axis?You can ignore this particular warning. It should not be shown when
time-scaled values is selected.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jeff" <Jeff@.discussions.microsoft.com> wrote in message
news:8344F12E-2AB5-4341-8FF3-46A553E2B242@.microsoft.com...
> I have a line chart with an x-axis of dates. When I enable "time-scaled
> values" on the x-axis of the chart properties, I get this warning and the
> chart does not graph the data properly.
> "The sorting applied to the category grouping of the chart 'chart2' is
> different from the grouping expression."
> If I disable "time-scaled values" the chart graphs the data properly,
> but
> then I see way too many date labels on the x-axis that makes it
> unreadable.
> Does anyone know how to resolve the above warning and still get the same
> readability on the x-axis?
>|||I noticed the warning on some of the Microsoft created reports that are
similar to mine, but the chart in my report does not graph the data
correctly. Instead of a slow growth curve, I get what looks like a toddler
scribbled on my graph. If I disable "time-scaled values" then the data
graphs properly, but then the x-axis is unreadable due to the numerous
samples of data.
"Robert Bruckner [MSFT]" wrote:
> You can ignore this particular warning. It should not be shown when
> time-scaled values is selected.
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Jeff" <Jeff@.discussions.microsoft.com> wrote in message
> news:8344F12E-2AB5-4341-8FF3-46A553E2B242@.microsoft.com...
> > I have a line chart with an x-axis of dates. When I enable "time-scaled
> > values" on the x-axis of the chart properties, I get this warning and the
> > chart does not graph the data properly.
> > "The sorting applied to the category grouping of the chart 'chart2' is
> > different from the grouping expression."
> > If I disable "time-scaled values" the chart graphs the data properly,
> > but
> > then I see way too many date labels on the x-axis that makes it
> > unreadable.
> > Does anyone know how to resolve the above warning and still get the same
> > readability on the x-axis?
> >
>
>|||If time-scaled is turned OFF, you have to add an explicit sorting expression
on the chart category groups. The sorting has to be identical to the
grouping expression. Then the data will be sorted and you will get a slow
growth curve.
You can solve the issue with too many labels on the x-axis by setting the
x-axis MINOR interval value to e.g. 5 (i.e. one label per 5 categories /
data samples).
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jeff" <Jeff@.discussions.microsoft.com> wrote in message
news:7BED67CB-B8E0-4D08-8F80-CB4DD2463EF7@.microsoft.com...
> I noticed the warning on some of the Microsoft created reports that are
> similar to mine, but the chart in my report does not graph the data
> correctly. Instead of a slow growth curve, I get what looks like a
> toddler
> scribbled on my graph. If I disable "time-scaled values" then the data
> graphs properly, but then the x-axis is unreadable due to the numerous
> samples of data.
> "Robert Bruckner [MSFT]" wrote:
>> You can ignore this particular warning. It should not be shown when
>> time-scaled values is selected.
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Jeff" <Jeff@.discussions.microsoft.com> wrote in message
>> news:8344F12E-2AB5-4341-8FF3-46A553E2B242@.microsoft.com...
>> > I have a line chart with an x-axis of dates. When I enable
>> > "time-scaled
>> > values" on the x-axis of the chart properties, I get this warning and
>> > the
>> > chart does not graph the data properly.
>> > "The sorting applied to the category grouping of the chart 'chart2'
>> > is
>> > different from the grouping expression."
>> > If I disable "time-scaled values" the chart graphs the data properly,
>> > but
>> > then I see way too many date labels on the x-axis that makes it
>> > unreadable.
>> > Does anyone know how to resolve the above warning and still get the
>> > same
>> > readability on the x-axis?
>> >
>>

Friday, February 24, 2012

chart question

I want to be able show the numbers on chart incrementally. For example,
where if i have the values as 2, 5, 8 on chart, I would like to show as 2,
7, and 15 .. and so onâ?¦ can you help me with this please?
This is my formula for the chart â?¦
=Sum(Fields!NumberOfCrs.Value)
Thank youDid you try runningValue function?
like
=runningValue(Fields!NumberOfCrs.Value,sum,"chart1_SeriesGroup1")

Chart Problem: Multiple values to y-axis for the the same x-axis value

I have a simple-column chart and in the x-axis I put the date values and in the y-axis the sale price values.

The chart works perfectly in the case when there is only one sale price for the same date. But, when the price changes during the same day, then there is problem. In the following example

x y

1/1/2007 6.25

2/1/2007 7

2/1/2007 4

3/1/2007 8

the chart will have three columns and in the date 2/1/2007 will display the min or max of the two values. What I need is to represent all the values i.e. the chart must have four columns , as much as the rows of the dataset

Is it possible?

It sounds like your category grouping is based on the DateTime value. Therefore, data values with the same timestamp are grouped together.

You will need to change the category grouping similar to the "StepFunctionChart" sample discussed in the following whitepaper (near the end): http://msdn2.microsoft.com/en-us/library/aa964128.aspx - search for "StepFunctionChart".

Basically, you need a category grouping expression that will make sure every data row is its own group, e.g. by concatenation:

=Fields!Y.Value & "|" & Fields!TimeStamp.Value

-- Robert