cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying % sign along with the value in a Crosstab

former_member544949
Participant
0 Kudos

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!!

TammyPowlas
Active Contributor
0 Kudos

Hi - what is your data source? Does the % need to be in a script, or would having it be in the header be enough? See https://blogs.sap.com/2015/11/27/custom-measures-calculations-sap-design-studio-16/

former_member544949
Participant
0 Kudos

Thanks Tammy for your response. My Data source is a BEX query.

"%" sign is not enough in the header but is required with each value.

Regards.

View Entire Topic
TammyPowlas
Active Contributor
0 Kudos

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-...

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

former_member544949
Participant
0 Kudos

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!!