Is there a way to display a string in cell?
I am wondering if there is way to aggregate the string in column and display it if it’s a unique value and display empty if it’s not unique?
Thanks,
1 answer
Hello, Allen,
Thank you for reaching out to us.
We would like to kindly inform you that only count
and distinct count
aggregations are available for the string
data type.
However, as a workaround, we suggest using the customizeCell
API call in order to achieve the desired functionality. For example, an approach for your case can be similar to the following:
-
Specify the hierarchy named “Description_identifier” and place a unique description identifier in it. The hierarchy is going to be used as a wrapper for an actual description.
{
...
"Description_identifier": 0
},
{
...
"Description_identifier": 1
},
... -
Adjust the
customizeCell
method so it replaces the cell’s inner text with an appropriate description. E.g.:pivot.customizeCell(function customizeCellFunction(cell, data) {
if (
data.measure &&
data.type != "header" &&
data.measure.uniqueName == "Description_identifier"
)
cell.text = descriptions[data.value];
});
Please check out an example we have prepared for you.
More information about customizeCell
API provided by Flexmonster can be found following the link: customizeCell method.
We hope it works for you.
Do not hesitate to contact us in case of any additional questions on this point.
Best regards,
WebDataRocks Team