Forum Discussion

MarkBird's avatar
MarkBird
Contributor III
2 years ago

Use XFMemberProperty to get year from time parameter

Hi  I'm looking to get the year from a time parameter to use in a cube view header. Is it possible to use the XFMemberProperty rule if possible? I've tried :Name(XFMemberProperty(DimType=Time, Memb...
  • JackLacava's avatar
    2 years ago

    Are you sure you can't do it with one of the substitution variables? |WFYear|, |PovYear|, |CVYear| ... ?

    If you have to go down the scripting route (be it in XFBR or CV Extender), I'd suggest to get the year in the "proper" way, to avoid issues with funky Time Profiles:

    Dim nValue As Integer = BRApi.Finance.Time.GetYearFromId(si, _
        BRApi.Finance.Members.GetMemberId(si, _
           DimType.Time.Id, "yourMemberName"))

    A bit slower than string manipulation but more robust.