COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: lorenmario on 07 Apr 2015 02:26:05 PM

Title: Problem to hide conditional column in Crosstab
Post by: lorenmario on 07 Apr 2015 02:26:05 PM
Hello,

I am creating a report using a relational package, SQL database, I'm using Report Studio 10.2.1.

I have used a boolean variable to conditionally hide a crosstab column nested.

The problem i'm facing is when i set the box type as "none" for the hidden column , the crosstab's columns cells are getting misaligned with the column headers. Is this a bug with BoxType property ?
Is is there any other way that we can conditionally hide the columns via a prompt without using the "box type" property?

To make it easier to understand the problem, appends an image of the crosstab, with the conditional variable set to yes, and an image of the conditional variable set to no.

Appreciate your response!!!

Title: Re: Problem to hide conditional column in Crosstab
Post by: satishsure on 16 Apr 2015 01:00:39 AM
I am also facing same kind of issue.If you know any anwer ..please do reply here..Thank you
Title: Re: Problem to hide conditional column in Crosstab
Post by: BigChris on 16 Apr 2015 02:08:19 AM
Not a direct answer to your question, but it might give you a fix for now. Couldn't you create two versions of your crosstabs, one with the column and one without? Then render the crosstabs based on your boolean variable.
Title: Re: Problem to hide conditional column in Crosstab
Post by: TheFrenchGuy on 21 Apr 2015 02:12:54 AM
Hello all,

the other way is to bring the data item you want to hide out, and apply your variable to this.

so you will have 3 columns :

<Statuts>                     <Status>                                <Growth>
<Count>                   <Unidades>  <Net Sales>      <%Units>  <%Net sales>


Don't forget to apply the style variable on your measure too.
Title: Re: Problem to hide conditional column in Crosstab
Post by: Virgin on 21 Apr 2015 02:27:21 AM
BigChris has the best solution, copy your crosstab actual on the same page, now you have 2 crosstab, one with the column and the 2nd without the column, now you use your booleen variable to appear one crosstab in one case and the other crosstab in other case.
Title: Re: Problem to hide conditional column in Crosstab
Post by: BigChris on 21 Apr 2015 02:39:30 AM
QuoteBigChris has the best solution

8) that doesn't happen very often!
Title: Re: Problem to hide conditional column in Crosstab
Post by: TheFrenchGuy on 21 Apr 2015 03:09:23 AM
 :'(

ps : to render a crosstab you have to put it in a block.
Title: Re: Problem to hide conditional column in Crosstab
Post by: Robl on 21 Apr 2015 09:37:45 AM
Select the column you don't want to show.
Set the border as none, the padding as 0pts on the left and right.
Unlock the report, select the text item in the column and set it to box type none.

The column is still there - it's just not visible any more.

Unless you export it to excel.
Title: Re: Problem to hide conditional column in Crosstab
Post by: Arhinoa on 11 Mar 2016 04:20:42 AM
Quote from: Robl on 21 Apr 2015 09:37:45 AM
Select the column you don't want to show.
Set the border as none, the padding as 0pts on the left and right.
Unlock the report, select the text item in the column and set it to box type none.

The column is still there - it's just not visible any more.

Unless you export it to excel.

Hello,

I'm facing the same issue when trying to hide imbricated measures columns, and I don't know how to implement the solution shown above.
My Crosstab looks like this:
             A          B
      Qty Cost   Qty Cost
Row1
Row2
Row3

Result after hiding Cost Measure (conditional style BoxType None for header and fact cell) :

             A          B
      Qty Qty
Row1
Row2
Row3

Concerning the column header, there's no problem to hide it.
It's for the measure, how can I select only  the measure concerned by the header and hide it.

I'm aware that this question has been treated a year ago but I would appreciate a little help :) Thanks
Arhinoa
Title: Re: Problem to hide conditional column in Crosstab
Post by: adam_mc on 16 Mar 2016 12:58:43 PM
If you are forced to do it that way, set up the crosstab like:

               A    A        B     B
             Qty Cost   Qty Cost
Row1
Row2
Row3

Then do a box type None on BOTH the Column Header A/B (above cost) and the Cost Measure itselt.

That way when it slides, everything should align.

Hope that helps,
Adam.
Title: Re: Problem to hide conditional column in Crosstab
Post by: Arhinoa on 18 Mar 2016 06:16:11 AM
Quote from: adam_mc on 16 Mar 2016 12:58:43 PM
If you are forced to do it that way, set up the crosstab like:

               A    A        B     B
             Qty Cost   Qty Cost
Row1
Row2
Row3

Then do a box type None on BOTH the Column Header A/B (above cost) and the Cost Measure itselt.

That way when it slides, everything should align.

Hope that helps,
Adam.

Thank you for your answer adam_mc, it would have been the best workaround if I had only one cost column. But I have 4 types of cost, and users can choose to show the 4 columns at the same time. It will show the header (A or B) 4 times  :-[

I finally found a way to hide my columns without misaligning column headers.
I modified my crosstab so as to have void text instead of Data Item Label (for headers) / Cell value for columns that have to be hidden.
I created boolean variables (instead of conditional styles) and associated them as Style variable AND text source variable for each crosstab member and crosstab intersection to hide.
When my boolean variable = Yes, I show my column as Data Item Label (for headers) / Cell value for columns to hide
when my boolean variable = No, I put Border = None and Padding = 0px.

It really took long time to implement but it works.
I hope it will help someone, someday :)