Showing posts with label evaluate. Show all posts
Showing posts with label evaluate. Show all posts

Friday, March 23, 2012

Finding a Member

Hi,
I try to evaluate a functionality to find a date-Member. Wath we need
is, we search the first existing Date in our Time-Dimension, which is,
say 11 days before the actual-date. Since such a Member maybe not
exits, the function should return the smallest existing Date bigger then the
one we are searching for.

MEMBER [MEASURES].[date1] AS
DATEADD("d", -11, CDate([Zeit].[Zeit].CURRENTMEMBER.MEMBER_CAPTION))
MEMBER [MEASURES].[mydate] AS
FILTER([Zeit].[Zeit].[Datum].members,
cdate([Zeit].[Zeit].[Datum].value) >= [MEASURES].[date1]).Item(0)
It doesn’t work in that way.
Can anybody give me some Help.
Thank you very much.

Bahram.

Looks like the problem here with the use of .Value function, which will retrieve cell value. If you are using AS2005, you can rewrite the Filter to be

FILTER([Zeit].[Zeit].[Datum].members, [Zeit].[Zeit].CurrentMember.MemberValue >= [MEASURES].[date1]).Item(0))

HTH

Mosha (http://www.mosha.com/msolap)

|||

Hi,

I tried your Formula. It doesn't work, i.e. it returns all Dates (([Zeit].[Zeit].[Datum].members). I think, it's becouse of the calculation of [MEASURES].[date1]. It uses the Currentmember and wenn the filter itterates through the members, it calculates the [MEASURES].[date1] again and again.

I don't know, if its correct or not!

Thanke you

|||Sorry - I didn't notice that date1 was going against CurrentMember in Zeit dimension. It needs to be fixed on the particular date that you are interested in for this Filter to work correctly.sql

Wednesday, March 21, 2012

Find UNICODE Data

How can you find UNICODE date within char & varchar fields in table.
I am in the midst of a migration and need to evaluate all the fields that
may have €
chinese, french and thus require more char space in the new structure.
This is a matter of great urgency so any help greatly appreciated.
Thanks
marcIf the fields are not a Unicode data type, then there is no Unicode data in
them. If the characters are not supported by the code page of the field
(defined by its by collation), they are lost (will show up as '?'). If they
are supported by the code page, you can search for them like you normally
would, or by using full-text search.
David Barber [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"marcmc" <marcmc@.discussions.microsoft.com> wrote in message
news:699A4648-85DC-4B5F-A876-6B223CD4A5DE@.microsoft.com...
> How can you find UNICODE date within char & varchar fields in table.
> I am in the midst of a migration and need to evaluate all the fields that
> may have ?
> chinese, french and thus require more char space in the new structure.
> This is a matter of great urgency so any help greatly appreciated.
> Thanks
> marc