Convert a string into INT

Hello All, 

Sorry if this has been asked, i was unable to find it.
But i am in dire need of being able to convert a field that has dollar signs in it.

Example:

Name     SalePrice
User1     $40,000
User2     $59,000
User3     $87,000

When i try to do a substr, it returns the "40,000", "59,000" and "87,000". But it doesn't convert it into a INT so i can run arithmetic on it such as sum/avg etc

1 Reply

SU Suriya Syncfusion Team July 18, 2018 05:47 AM UTC

Hi Basel, 

Create an expression to remove the special symbols and convert the same to Integer after connecting to your data in Dashboard Designer and get the string value without special symbols. Refer to the User guide about Expression Columns: https://help.syncfusion.com/dashboard-platform/dashboard-designer/transforming-data/configuring-expression-columns  
For example,  
Expression Name: SalesPriceAsInteger 
Expression : CAST(Replace(Replace([Sales Price], '$', ''), ',', '') as integer) 
 
 
 
Then you can bind this value into your dashboard widget and you can format the representation and its type. Refer to the User guild to format a measure, https://help.syncfusion.com/dashboard-platform/dashboard-designer/compose-dashboard/formatting-measure-type-column  
 

Please revert back if this resolves for your requirement. 

Thanks, 
Suriya 


Loader.
Up arrow icon