Totalling hours and minutes | XM Community
Solved

Totalling hours and minutes

  • 13 January 2021
  • 4 replies
  • 46 views

Badge +2

Hi all,
I've created a matrix table question where users input the time a store opens and closes (below)
I'd like to be able to show them in a question underneath "you indicated that you are open for X hours a week, how many of these are staffed?"
What is the best way of being able to total the open hours? I'm assuming js of somekind but not sure where to start
many thanks in advance!
image.png

icon

Best answer by ahmedA 13 January 2021, 20:31

View original

4 replies

Userlevel 7
Badge +21

You can use the code posted here.
This is a working demo for the same.

Badge +2

https://www.qualtrics.com/community/discussion/comment/33366#Comment_33366ahmedA Thanks for this, but the demo doesn't work, it seems to have mm/dd/yyyy validation in place which doesn't accept hh:mm

Userlevel 7
Badge +21

Sorry for that. I was checking if they had any validation available for the HH:MM type...and selected that.
You can see the demo now.

Badge +2

https://www.qualtrics.com/community/discussion/comment/33392#Comment_33392Thanks ahmedA I can see that working now! I'll save that code for future use!
Unfortunately I forgot to mention that this is within a loop and merge, and I can't seem to make it re-embed the data for each loop. I'm wondering if I'd be better trying to create some kind of horizontal constant sum instead

Leave a Reply