none
Error using FILTER and GENERATE functions.--The GENERATE function expects a string or numeric expression for the argument. RRS feed

  • Question

  • I have a problem, and i don't know how to fix it.

    I have a cube for sales and a PRODUCT dimension.

    I try to filter a hierarchy from PRODUCT dimension and I receive this error:

    The GENERATE function expects a string or numeric expression for the argument. A tuple set expression was used.

    The MDX query I use is listed above.

    WITH

    MEMBER [MEASURES].[DEFAULT MEASURE] AS

    (

    [Measures].[Sales]

    ,[CURRENCY].[CURRENCY].&[USD]

    ,[TIME].[TIME].[QUARTER].&[2006Q2]

    )

    SET [GENERATED SET] AS

    (

    [PRODUCT].[CORPORATION].[ALL],

    [PRODUCT].[CATEGORY].[ALL],

    [PRODUCT].[PRODUCT NAME].[ALL]

    )

    +

    GENERATE(

    (

    [PRODUCT].[CORPORATION].CHILDREN,

    [PRODUCT].[CATEGORY].CURRENTMEMBER,

    [PRODUCT].[PRODUCT NAME].CURRENTMEMBER

    )

    ,

    (

    [PRODUCT].[CORPORATION].CURRENTMEMBER,

    [PRODUCT].[CATEGORY].[ALL],

    [PRODUCT].[PRODUCT NAME].[ALL]

    )

    +

    GENERATE(

    FILTER(

    (

    [PRODUCT].[CORPORATION].CURRENTMEMBER,

    [PRODUCT].[CATEGORY].CHILDREN,

    [PRODUCT].[PRODUCT NAME].CURRENTMEMBER)

    ,[MEASURES].[DEFAULT MEASURE] > 10000

    )

    ,

    (

    [PRODUCT].[CORPORATION].CURRENTMEMBER,

    [PRODUCT].[CATEGORY].CURRENTMEMBER,

    [PRODUCT].[PRODUCT NAME].[ALL]

    )

    +

    (

    [PRODUCT].[CORPORATION].CURRENTMEMBER,

    [PRODUCT].[CATEGORY].CURRENTMEMBER,

    [PRODUCT].[PRODUCT NAME].CHILDREN

    )

    )

    )

    SELECT

    {

    (

    [Measures].[Sales]

    ,[CURRENCY].[CURRENCY].&[USD]

    ,[TIME].[TIME].[QUARTER].&[2006Q2]

    )

    } ON COLUMNS,

    NONEMPTY

    (

    [GENERATED SET]

    ,[MEASURES].[DEFAULT MEASURE]

    )

    ON ROWS

    FROM [SALES]

    I receive this error only when I'm using the FILTER function on [PRODUCT].[CATEGORY].

    When I use the FILTER funtion on CORPORATION and PRODUCT NAME the query runs without error.

     

     

    Tuesday, January 9, 2007 8:38 AM