Convert calculated field from String to Integert type

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

2 Likes

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.

4 Likes

Hi @tarushtg @Sanjeeb2022 ,
Has the parseDouble and parseFloat been removed from Quicksight because I cannot see them on Quicksight?
image

Regards
Dipanshu

Hi @dipanshugarg - Not sure, but in documentation it is also not there.

Hi @DylanM - any clue on this.

Regards - Sanjeeb

1 Like

Hello @Sanjeeb2022, I actually don’t ever remember seeing those calculations in QuickSight. Maybe all of the necessary functionality is wrapped into parseDecimal?

@dipanshugarg, if you are running into an error or are wanting to figure out how to parse a value in QuickSight, please post a new topic in the community with more information, and we can guide you further. That will ensure you are at the top of the priority list for a response from one of our QuickSight experts. Thank you!