Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  Conditional Display of Multiple Nested Measures in Crosstab

    Posted Sat May 04, 2024 03:26 PM

    I'm currently developing a crosstab report in Cognos Report Studio where "Month (Ship Date)" is set as a column header with nested measures for "Revenue" and "Quantity". The rows are structured using the "Product Line" column.

    I've set up a multi-select parameter prompt to conditionally display these measures. For example, if "Revenue" is selected, "Quantity" should be hidden, and vice versa. This is controlled using a style variable, setting the box type of the measure column to null based on the selected parameter.

    However, I'm facing an issue where, upon hiding one measure, the alignment and spanning of the remaining measure across the months become disrupted. For example, when only "Revenue" is visible, it doesn't span correctly across all months, leaving blank spaces. I've attached a screenshot for a clearer understanding.

    Could anyone provide insights or suggestions on how to maintain proper alignment and spanning in the crosstab when a measure is conditionally hidden? Any advice or workaround would be greatly appreciated.



    ------------------------------
    Zameer Sayed
    ------------------------------


  • 2.  RE: Conditional Display of Multiple Nested Measures in Crosstab
    Best Answer

    Posted Sat May 04, 2024 09:03 PM

    I resolved the display issue in the crosstab report by utilizing the row and column suppression features and adjusting the expressions for the "Quantity" and "Revenue" measures. This ensured that any measure not selected in the p_measure prompt is set to 0.

    For the "Quantity" measure, the expression used is:

    case when #sq(promptmany('p_measure'))# contains 'Quantity' then
        [Sales (query)].[Sales].[Quantity]
    else 
        0 
    end


    For the "Revenue" measure, the expression is:

    case when #sq(promptmany('p_measure'))# contains 'Revenue' then
        [Sales (query)].[Sales].[Revenue]
    else 
        0 
    end



    ------------------------------
    Zameer Sayed
    ------------------------------