Sunday, February 19, 2012

Array in expression editor anyone?

I'm kind of a newbie at all this and I'm wondering if I can do the
following. Whithout having to use custom code is there a way to use the IN
function in the expression editor?
I'm currently using the following to accomplish something quite simple:
=IIF((month(Fields!por_POSTING_DATE.Value) = 10 or
month(Fields!por_POSTING_DATE.Value) = 11 or
month(Fields!por_POSTING_DATE.Value) = 12), True,False)
I'd like to use:
=IIF(month(Fields!por_POSTING_DATE.Value) in (10,11,12),True,False)
Can you not use an array in the expression editor (and only in custom code?)
Thanks,
RyanHere's one way to do it:
=iif(Array.BinarySearch(new Integer() {10,11,12},
month(Fields!por_POSTING_DATE.Value))>=0,True,False)
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"Ryan Opfer" <ropfer@.usa.ibs.org> wrote in message
news:evyaKVzeEHA.2352@.TK2MSFTNGP09.phx.gbl...
> I'm kind of a newbie at all this and I'm wondering if I can do the
> following. Whithout having to use custom code is there a way to use the
IN
> function in the expression editor?
> I'm currently using the following to accomplish something quite simple:
> =IIF((month(Fields!por_POSTING_DATE.Value) = 10 or
> month(Fields!por_POSTING_DATE.Value) = 11 or
> month(Fields!por_POSTING_DATE.Value) = 12), True,False)
> I'd like to use:
> =IIF(month(Fields!por_POSTING_DATE.Value) in (10,11,12),True,False)
> Can you not use an array in the expression editor (and only in custom
code?)
> Thanks,
> Ryan
>|||Thanks Chris that worked great.
Ryan
"Chris Hays [MSFT]" <chays@.online.microsoft.com> wrote in message
news:%23OSa8%23AfEHA.3612@.TK2MSFTNGP12.phx.gbl...
> Here's one way to do it:
> =iif(Array.BinarySearch(new Integer() {10,11,12},
> month(Fields!por_POSTING_DATE.Value))>=0,True,False)
> --
> This post is provided 'AS IS' with no warranties, and confers no rights.
All
> rights reserved. Some assembly required. Batteries not included. Your
> mileage may vary. Objects in mirror may be closer than they appear. No
user
> serviceable parts inside. Opening cover voids warranty. Keep out of reach
of
> children under 3.
> "Ryan Opfer" <ropfer@.usa.ibs.org> wrote in message
> news:evyaKVzeEHA.2352@.TK2MSFTNGP09.phx.gbl...
> > I'm kind of a newbie at all this and I'm wondering if I can do the
> > following. Whithout having to use custom code is there a way to use the
> IN
> > function in the expression editor?
> > I'm currently using the following to accomplish something quite simple:
> >
> > =IIF((month(Fields!por_POSTING_DATE.Value) = 10 or
> > month(Fields!por_POSTING_DATE.Value) = 11 or
> > month(Fields!por_POSTING_DATE.Value) = 12), True,False)
> > I'd like to use:
> > =IIF(month(Fields!por_POSTING_DATE.Value) in (10,11,12),True,False)
> >
> > Can you not use an array in the expression editor (and only in custom
> code?)
> >
> > Thanks,
> >
> > Ryan
> >
> >
>

No comments:

Post a Comment