cancel
Showing results for 
Search instead for 
Did you mean: 

Adding symbol in Pivot table

rahuldhomane
10 - ETL
10 - ETL

Hi,

Is there a way to add symbols like Tickmark and Cross in one particular column in  pivot chart instead of binary values like 0 or 1?

1 ACCEPTED SOLUTION

alek
8 - Cloud Apps
8 - Cloud Apps

Hi @rahuldhomane ,

if you already have column with 0 and 1, you can use widget script to replace values.

 

const myTarget = {
 type: ['value'],
 values: [
  {
   title: 'Total Cost' // put here desired column
  }
 ]
};


widget.transformPivot(myTarget, function(metadata, cell) {
        if (cell.value = 1) {
     cell.content = "✔";
       } 
        else if (cell.value = 0) {
     cell.content = "✖";
       } 
});

this script uses pivot2 api  - Pivot 2.0 API 

- Alek



 

View solution in original post

4 REPLIES 4

jirazazabal
9 - Travel Pro
9 - Travel Pro

Have you checked this one? 

https://community-old.sisense.com/hc/en-us/community/posts/221225548-Add-Image-Indicator-to-a-Pivot-...

If not, you always can do it with JS

Hope it helps

Thanks @jirazazabal 

alek
8 - Cloud Apps
8 - Cloud Apps

Hi @rahuldhomane ,

if you already have column with 0 and 1, you can use widget script to replace values.

 

const myTarget = {
 type: ['value'],
 values: [
  {
   title: 'Total Cost' // put here desired column
  }
 ]
};


widget.transformPivot(myTarget, function(metadata, cell) {
        if (cell.value = 1) {
     cell.content = "✔";
       } 
        else if (cell.value = 0) {
     cell.content = "✖";
       } 
});

this script uses pivot2 api  - Pivot 2.0 API 

- Alek



 

Thanks @alek . It worked and I got what I expected. Only change needed was

(cell.value = 1) to (cell.value==1)
(cell.value = 0) to (cell.value==0)