none
Format function is returning an error RRS feed

  • Question

  • Hello,

    In one of my MDX query, for one of the attribute value i have to convert the negative value to paranthesis so im using the following query.

    SELECT

    {}

    ON

     COLUMNS,

    Order

    (({[Task].[Project Number].[Project Number].ALLMEMBERS },

    {[Task].[Name].[Name].

     

    {[Task].[Planned Finish Date].[Planned Finish Date].

    ALLMEMBERS },

    {[Task].[Actual Finish Date].[Actual Finish Date].

    ALLMEMBERS },

    {[Task].[Forecast Finish Date].[Forecast Finish Date].

    ALLMEMBERS },

    { Format([Task].[Weeks Delta To Current Plan].[Weeks Delta To Current Plan].

    ALLMEMBERS, "#,##0;(#,##0)") }),

    CDATE([Task].[Planned Finish Date].

    MEMBERVALUE),BASC)

    ON

     

     

    [Bv Insight Schedule Milestones]

    Where

    [Task].[Revenue Package Number].DEFAULTMEMBER

    In this Query, im displaying the values from dimension attributes as i dont have any measures in fact.

     

     

    But am getting following error. "

     

     

    Execution of the managed stored procedure Format failed with the following error: Microsoft::AnalysisServices::AdomdServer::AdomdException.

    Query (9, 3) The function expects a string or numeric expression for the 1 argument. A tuple set expression was used."

    

    Please help me on this to resolve.

    Thanks

    ROWS

    FROM

     

    ALLMEMBERS },
    • Edited by Mike RGO Monday, October 31, 2011 7:39 AM
    Monday, October 31, 2011 7:39 AM

Answers

  • Your best bet would be to change this in the database view referenced for the attribute, in the data source, or setup a measure that does this for you by doing a reference to the the current member of that attribute hierarchy and do the formatting in the measure and include the measure in the query.
    Dan English's BI Blog
    Tuesday, November 1, 2011 11:18 AM