Cognos Analytics

Cognos Analytics

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

 View Only
  • 1.  Requirement to hide particular columns of a list report based on a prompt value.

    Posted Fri August 13, 2021 02:55 PM

    Cognos Analytics 11.1.7

     

    If the prompt is set to year 202021 then I wish to hide list columns relating to 201920 and 201819.  This I can do successfully using boolean variables and the conditional state. 

     

    When I select the prompt value of the previous year (201920) I wish to display the 201920 & 202021 list columns but hide the 201819 related list columns.

    When I select the prompt value of 201819 then I wish to display 201819 & 201920 & 202021 list columns

     

    However I do not appear to be able to achieve this using boolean variables and the condition state as each column in the list only appears to be able to hold 1 Style variable and

    overwrites when another style variable is applied

     

    The image below may help clarify the requirement.

     

     

    Any advice how this can be achieved.

     

    Thanks in advance

    Brian

     

     

    Telephone  +44 28 7012 4598

    Email - b.mcgowan@ulster.ac.uk

     



    This email and any attachments are confidential and intended solely for the use of the addressee and may contain information which is covered by legal, professional or other privilege. If you have received this email in error please notify the system manager at postmaster@ulster.ac.uk and delete this email immediately. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Ulster University.
    The University's computer systems may be monitored and communications carried out on them may be recorded to secure the effective operation of the system and for other lawful purposes. Ulster University does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of a separate attachment, the text of email is not intended to form a binding contract. Correspondence to and from the University may be subject to requests for disclosure by 3rd parties under relevant legislation.
    The Ulster University was founded by Royal Charter in 1984 and is registered with company number RC000726 and VAT registered number GB672390524.The primary contact address for Ulster University in Northern Ireland is Cromore Road, Coleraine, Co. Londonderry BT52 1SA

    #CognosAnalyticswithWatson


  • 2.  RE: Requirement to hide particular columns of a list report based on a prompt value.

    Posted Mon August 16, 2021 05:08 AM
    Hi Brian,

    In the samples, there is a report called "List Column Display". This sample report uses a Custom Control and JavaScript to allow the user to choose which columns in a list to display. 

    I think it might be useful for what you are looking for.

    Best regards,

    Patrick

    ------------------------------
    Patrick Neveu
    Consultant
    Positive Thinking Company
    Paris
    ------------------------------



  • 3.  RE: Requirement to hide particular columns of a list report based on a prompt value.

    Posted Mon August 16, 2021 08:20 AM
    Instead of using a boolean variable, make a string variable whose expression is simply the prompt value (EX: ?pyears?) with all the possible choices being those of the prompt box.  Then on your list select the column, make sure the object property you are changing is list column, not title or text.  Select render variable, then your variable, and check for which values of your prompt you want the column to render for. 

    Example of using a string variable to render vs boolean


    ------------------------------
    Chris Stadler
    ------------------------------



  • 4.  RE: Requirement to hide particular columns of a list report based on a prompt value.

    Posted Mon August 16, 2021 09:52 AM
    Brian,

    Using a render variable on a column is an inefficient way to handle this situation--regardless of the value of the prompt, your query returns 4 years of data, then suppresses display of half of the results.

    Instead, use the query filter to exclude and include the years you want. The report won't display a column for which there is no data. I also agree with the recommendation to use a string variable rather than a boolean; that will make your report more flexible, down the road. You'll be able to craft the query filter to derive the two years to report out of an infinite range of years, rather than making it an either/or choice of two of four years. In fact, in this kind of situation, I'd likely make my prompt a multi-select, and offer the user a checklist of years, and by referencing the prompt value(s) in my query filter, select (and display) only the years desired, e.g. [myDataSource].[year] IN (?myYearPrompt?). 

    You'll need to adjust the technique a little depending on whether your DB is storing your [year] values (or whether you derive the year) as string or numeric values.

    Good luck.

    ------------------------------
    Michael Walter
    Business Analyst
    TX HHSC
    Austin
    ------------------------------



  • 5.  RE: Requirement to hide particular columns of a list report based on a prompt value.

    Posted Mon August 23, 2021 08:42 AM

    Assuming this is a list and not a crosstab...

    Even if this is a list as said in another comment  you should adjust your query to only bring back the required data.

    Assuming its a list, and you have data items in your query for each year, and you want to hide the columns. Given that it looks like the columns are based on fiscal years, 20182019, 20192020 and so on.

    You could just make your boolean render variables a > rather than an equals.

    ie for column 20182019 the render variable would be 20182019 >= ?promptyear? , for column 20192020 the render var would be 20192020 >= ?promptyear?




    ------------------------------
    Marc Reed
    ------------------------------