Hi in a hosted table created from a uploaded csv, I have a field which contains minutes data, such as
totalminutes |
30 |
48 |
50 |
20 |
25 |
Which was for some reason, uploaded as fieldtype string, even though I specified the fieldtype as integer when I first uploaded the csv (same also occurred when trying to specify dates as fieldtype date).
I want to make a new field in ArcGIS online, which would contain hours data calculated from totalminutes. I've tried creating a new field with fieldtype integer and using SQL totalminutes/60. However, this only returns whole numbers like 0, 1 and 2s, which seem to be rounded numbers, rather than 0.5, 0.75 etc.
However when I create a new string field and use the above formula, it returns correct results (0.5, 0.75 etc). I need the hours field to be a integer field though, since I need to use SUM on this field in Dashboard. Any ideas on how I can achieve this in ArcGIS onlline?
Thanks!
Solved! Go to Solution.
Hi @JulietK ,
If the totalminutes is string you will need to cast it to correct data type and then use the below to calculate
CAST(totalminutes AS FLOAT)/60
Cheers,
Manish
______________________________________________________________________________________________
If the answer solved your question or if you found it helpful please mark it accordingly to help others who have the same question.
Hi @JulietK ,
Have you tried using the Double instead of integer.
integers are numbers without decimals. double is a floating-point numbers with double precisions.
Hope this helps.
______________________________________________________________________________________________
If the answer solved your question or if you found it helpful please mark it accordingly to help others who have the same question.
Hi Manish, thank you for your response.
Unfortunately creating a new field with fieldtype double and using the same formula still returns rounded whole numbers only. Very weird!
Hi @JulietK ,
If the totalminutes is string you will need to cast it to correct data type and then use the below to calculate
CAST(totalminutes AS FLOAT)/60
Cheers,
Manish
______________________________________________________________________________________________
If the answer solved your question or if you found it helpful please mark it accordingly to help others who have the same question.