Help with Grouping's group expression?

dkim18
dkim18 used Ask the Experts™
on
Hi,

Can someone explain or point to a webpage where it explains how to use the Grouping's group on expression section in more depth?
You know in the Group On expression, you can have multiple expressions.
1) Can I think of those multiple expressions as multiple filer queries to group?
2) In the Group on Experssion, is this kind of expression allowed?
Say I have this table with the following fields(Color,Shape,Points)
Color can be yellow,red,blue
Shape can be circle, square,rectangle
Points can be 1,2,3, 4


I want to group them by Shape and group on retangle in more detail.
So in my experssio I put
=Fields!Color.Value
=Fields!Shape.Value ="rectangle" and Fields!Color.Value <> "Yellow"
=Fields!Shape.Value ="rectangle" and Fields!Color.Value ="Yellow" and Fields!Points.Value = 3


Are these OK experssions?

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
This is how you can do it.

there are multiple ways to do this

one is to make a function that returns the group value

or use a iif statement

go the the grouping and for the group by select function

then enter something line

=IIF(Fields!Shape.Value ="rectangle" and Fields!Color.Value <> "Yellow","Group1",
iif (Fields!Shape.Value ="rectangle" and Fields!Color.Value ="Yellow" and Fields!Points.Value = 3,"Group2"),"group3"))


Author

Commented:
Thanks.
I see what you did but I also want to group on Color.
I guess my question is is having multiple expressions to represent what you have is OK too?
Like below:

=Fields!Color.Value
=Fields!Shape.Value ="rectangle" and Fields!Color.Value <> "Yellow"
=Fields!Shape.Value ="rectangle" and Fields!Color.Value ="Yellow" and Fields!Points.Value = 3

Commented:
can you give a non coded logic of what you want to sort on.

you can set up the iif to do a lot.

I am not sure of the logic.  are you grouping on 1 2 3 items of data?
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Author

Commented:
Can we use the IsNot NOthing?

It seems to be working on one expression but not working on another expression for some reason.

I read somewhere Is Nothing and IsNot Nothing work.

Any idea?

Author

Commented:
Wonder if I can do <> Nothing

Author

Commented:
Can I aslo use Fields!Color.Value = Nothing?
Commented:
you need iif(IsNothing(Fields!Color.Value,"Yes","No")

Author

Commented:
Emes,

I apologize for asking same questions.

It is like I am writing a long where sql statement.
iif won't work for me I think.
I am doing something like this
a and b and (c or d) and (f is null or d is not null) and ((k is not null and g <>'yellow') and (g ='red' or m is not null)) and a and b and (c or d) and (f is null or d is not null) and ((k is not null and g <>'yellow') or a and b and (c or d) and (f is null or d is not null) and ((k is not null and g <>'yellow') and a and b and (c or d) and (f is null or d is not null) and ((k is not null and g <>'yellow')

iif returns two values, I just want to check if it is not just like in sql.
I need some like is nothing and isnot nothing to do my expression.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial