You can see that I am able to convert the millisecond to MM:SS format and display it in the table using the calculated field as below:
concat(
ifelse(floor({time} / 60000) < 10, concat(‘0’, tostring(floor({time} / 60000))), tostring(floor({time} / 60000))),
‘:’,
ifelse((floor({time} % 60000) / 1000) < 10, concat(‘0’, tostring(floor((floor({time} % 60000) / 1000)))), tostring(floor((floor({time} % 60000) / 1000))))
)
A is Sum of time field in seconds (using sum({time})/1000 )
B is Average of time in seconds (using avg({time})/1000)
In C I am trying to display either A or B in the format MM:SS using the calculated field as below:
concat(
toString(floor(B / 60)),
‘:’,
ifelse(
B - (floor(B / 60) * 60) < 10,
concat(‘0’, toString(B - (floor(B / 60) * 60))),
toString(B - (floor(B / 60) * 60))
)
)
I am aware that the field C is string and I tried to use “parseDecimal” or even “parseInt” to change the format in D but unfortunately none of the solution in either C or D fields gives me the desired end result. Instead in C I get We can't parse this SQL syntax. If you are using custom SQL, verify the syntax and try again. Otherwise, contact support. and in D I get NO DATA, to be able to view the final value of averaged time in the format MM:SS.
I am hoping I can get some assistance here and would greatly appreciate.
I have also tried the community solutions given in:
I tried using the provided solution and it works fine to show each data in the field of the dataset converted to the desired time format I want. See ref screenshot below:
in screenshot - averaging the time in column 2 (Time in seconds) and displaying it as a visual which here gives 273.98. Further converting it to integer displays 273. Now this 273 is in seconds and I want to view it in either HH:MM:SS or MM:SS. I tried using the formula you gave and I get the error as can’t parse SQL syntax.
This is where I need the assistance, if you can help with or guide me on how can I view this final averaged time value (in seconds) in MM:SS or HH:MM:SS format. Is this possible to do in quicksight or is it some sort of limitation?
I hope my question is clear now and I look forward to your repsonse.
Thank you sharing the links. I checked them but the issue still exists. As I stated in my reply earlier today that I want that averaged value “273 seconds” to show me as 1 value in visual in either HH:MM:SS or MM:SS format of time.
Let me share the question again below using the attached screenshot as reference:
The provided solution works for 7 count of events as shown in screenshot row by row and displays the converted time in desired format.
whereas if I go ahead with creating a new calculated field “sum(time)” where time contains values (47,43,43,41,39,39,39) respectively for corresponding 7 entries in row, I get an output of 291 seconds. Using the solution provided by you, or the solutions mentioned by others in the community with my input field now as field “sum(time)” - I get the parse error.
Hi @tsh1089,
It’s been awhile since last communication on this thread. Checking in to see if you were still having issues with your original topic or if you were able to find a work around?
If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.
Hi @tsh1089,
Since we haven’t heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information that may be needed.