Skip to Content

Displaying % sign along with the value in a Crosstab

Hi Experts,

I have a Crosstab which has three dimensions as rows and two measures as columns.

Column A : Total no. of employees

Column B : Percentage of employees.

The requirement from the business is to show “%” sign along with the Percentage value e.g. Column B values like 64.3%.

In order to show the % sign, I have used the following script in my CSS

.X .sapzencrosstab-DataArea>tbody>tr:nth-child(1)>td:nth-child(1):after{

content:"%";

}

With this script, % sign is displayed along with the value but after the value like

64.3

%

What should I change in the script to show “%” sign along with the value.

I am using SAP Design studio 16.5.0.

Any help will be greatly appreciated!!

Thanks!!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 29 at 07:20 PM

    Can you look at /try Vidya's post? https://blogs.sap.com/2016/12/08/format-your-own-symbol-in-the-crosstab-using-css-sap-design-studio-1.6/

    CSS looks similar, but a "before" where you have "after"

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Tammy,

      Thanks for your reply. The solution worked!!. But I did a small change in my CSS. writing it here, may be useful for someone in future.

      .crosstabpercent .sapzencrosstab-DataArea>tbody>tr>td:nth-child(even).sapzencrosstab-DataCellDefault>div:after {

      content: "%";

      }

      My crosstab, for some dimensions has a value and for some dimension has a blank. The problem is, with values I want to show % sign while with blanks nothing. Right now with the above code, it’s showing “%” sign even with blanks. Is there a workaround to put “%” sign conditionally ?

      Many thanks!!

  • Jan 30 at 05:56 AM

    Make a small change in your CSS as below:

    .X .sapzencrosstab-DataArea>tbody>tr:nth-child(1)>td:nth-child(1) div::after{
        content:"%";
    }
    Add comment
    10|10000 characters needed characters exceeded