Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field that contains the values 0,1,or 2 that correspond to No, Yes and N/A. I have that field in a pie chart and the legend displays 0,1, and 2. How can I change the legend to display something more meaningful like 'Yes', 'No', or 'N/A' instead. How would I accomplish this.
Hi,
if you want this in script level, try this
Load *,if(check=0,'No',if(check=1,'Yes',if(check=2,'N/A'))) as flag;
LOAD * INLINE [
Value, check
100, 0
200, 1
300, 2
];
If you want that in front end, try to add the calculated dimension like
=if(check=0,'No',if(check=1,'Yes',if(check=2,'N/A')))
sample attached for your reference.
Create a small table in the script before you load the table with the field that contains the 0,1 and 2 values:
TableX:
LOAD Dual(TextValue,MyField) as MyField INLINE [
MyField, TextValue
0, Yes
1, No
2, N/A
];
TableY:
LOAD
MyField,
OtherFields
FROM .... ;
What this will do is create values in TableX that are numbers that also have a textual display value. The numbers from the field MyField from TableY will also get this textual display value when you load them.
Hi,
if you want this in script level, try this
Load *,if(check=0,'No',if(check=1,'Yes',if(check=2,'N/A'))) as flag;
LOAD * INLINE [
Value, check
100, 0
200, 1
300, 2
];
If you want that in front end, try to add the calculated dimension like
=if(check=0,'No',if(check=1,'Yes',if(check=2,'N/A')))
sample attached for your reference.
Hi….worked beautifully as a calculated dimension
Hi,
if it is worked,
Could you please close this thread Mark as Correct / Helpful answer?
sure