I have created a calculated field using the substring function and now i want to convert the calculated field from string data type to Numerical data type but i not getting any function or formatting option please help me because by using this field i want to sort the visual.
Hi @Arpit6075 - can you try parseint. see the below documentation link -parseInt - Amazon QuickSight
Regards - Sanjeeb
If you have a calculated field in Quicksight that is currently of string data type and you want to convert it to a numerical data type, you can use the parseDouble
or parseFloat
function to achieve this.
Here’s an example of how you can convert a calculated field called “MyField” from string to numerical data type using the parseDouble
function:
parseDouble({MyField})
Similarly, if you need to convert the field to a float data type, you can use the parseFloat
function:
parseFloat({MyField})
To apply this conversion to your calculated field, you can create a new calculated field using the appropriate function. For example, if your current calculated field is called “MyCalculatedField” and you want to convert it to a numerical data type, you can create a new calculated field with the following formula:
parseDouble({MyCalculatedField})
After creating the new calculated field with the numerical data type, you should be able to use it for sorting and other numerical operations in your visualizations.
Note: When using the parseDouble
or parseFloat
functions, make sure that the string values in your calculated field can be successfully parsed as numbers. If there are any non-numeric values or formatting issues, the conversion may result in errors or unexpected results.