{"id":5501,"date":"2021-05-26T10:05:33","date_gmt":"2021-05-26T09:05:33","guid":{"rendered":"https:\/\/www.snapsurveys.com\/support-snapxmp\/?post_type=epkb_post_type_1&#038;p=5501"},"modified":"2023-10-10T15:10:43","modified_gmt":"2023-10-10T14:10:43","slug":"calculating-time-minutes-time-variables","status":"publish","type":"epkb_post_type_1","link":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/","title":{"rendered":"Calculating the time in minutes between two time variables"},"content":{"rendered":"\n<p>   With Snap XMP Desktop you can use times to analyze your survey response data. This tutorial explains how to set up the start and end time questions then create variables that calculate the time difference and show how to categorise this information as time bands. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Creating the time questions<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\n  In the Questionnaire window, create two open ended questions. These are used to enter the start time and end time. \n<\/li>\n\n\n\n<li>\n  In the Topics toolbar select Response and set the question response type to Time.\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Creating a variable to calculate the time difference<\/h2>\n\n\n\n<p>   A Variable needs to be set up in order to calculate the interval between the Start and End time. This variable needs to be set up as a Derived, Quantity-Response Variable. That is, a new variable deriving (taking information) from other variables. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\n  In the Variables window, click New Variable \n  <img decoding=\"async\" width=\"25\" height=\"26\" src=\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png\" class=\"wp-image-5502\" alt=\"NewIcon.png\">\n   to create a new Variable.\n<\/li>\n\n\n\n<li>Ensure the following settings are applied:\n<ul class=\"wp-block-list\">\n<li><strong>Name<\/strong>: V1\n    <\/li>\n\n\n\n<li><strong>Label<\/strong>: Time difference\n    <\/li>\n\n\n\n<li><strong>Type<\/strong>: Derived\n    <\/li>\n\n\n\n<li><strong>Response<\/strong>: Quantity\n    <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\n  In the Values column in the same row as Not Ask type: <strong>Q1 missing or Q2 missing.<\/strong> This will ensure that the time difference is not calculated if Q1 or Q2 are empty.\n<\/li>\n\n\n\n<li>\n  Type the formula below in the values column but this time in the same row as Valid:\n<\/li>\n<\/ol>\n\n\n\n<p><strong>((Q2\\1)*60 + (Q2-Q2\\1)*100) \u2013 ((Q1\\1)*60 + (Q1-Q1\\1)*100) + (1440 * num(Q2&lt;Q1))<\/strong>\n<\/p>\n\n\n\n<p>\n  The formula is divided into 3 sections. The first section converts the answers to Q2 into minutes, the second section converts Q1 into minutes. The last section is only needed if times could span midnight \u2013 it adds 1440 minutes if Q2 has an answer after midnight and Q1 has an answer before midnight.\n<\/p>\n\n\n\n<p><strong><em>Note:<\/em><\/strong> Time is analysed in minutes. There are 60 minutes in each hour and 1440 minutes in 24 hours: 60 (minutes in an hour) X 24 (hours in a day)\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Creating a derived variable to display time categories<\/h2>\n\n\n\n<p>   Another variable needs to be set in order to display the results in time categories. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>   In the Variables window, click New Variable    <img decoding=\"async\" width=\"25\" height=\"26\" src=\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-9.png\" class=\"wp-image-5503\" alt=\"NewIcon.png\">    to create a new Variable. <\/li>\n\n\n\n<li>Enter the following settings:\n<ul class=\"wp-block-list\">\n<li><strong>Name<\/strong>: V2     <\/li>\n\n\n\n<li><strong>Label<\/strong>: Time categories     <\/li>\n\n\n\n<li><strong>Text<\/strong>: Duration between start and end times     <\/li>\n\n\n\n<li><strong>Type<\/strong>: Derived     <\/li>\n\n\n\n<li><strong>Response<\/strong>: Single      <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>   Add the following code information in the Code list to create the categories and values: <\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Label<\/strong><\/td><td><strong>Value<\/strong><\/td><\/tr><tr><td>0 \u2013 15 minutes<\/td><td>V1&lt;=15<\/td><\/tr><tr><td>16 \u2013 30 minutes<\/td><td>V1&lt;=30<\/td><\/tr><tr><td>31 minutes \u2013 1 hour<\/td><td>V1&lt;=60<\/td><\/tr><tr><td>1 \u2013 2 hours<\/td><td>V1&lt;=120<\/td><\/tr><tr><td>3 hours and above<\/td><td>V1 ok<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>\n  Click on the Count Responses button to calculate the responses. The Counts column in the variable will display the results. \n<\/li>\n\n\n\n<li>\n  Click on the Save button. You can use the variable to create a table or chart of the results by entering the derived variable name in the analysis box of your table or chart to generate the results.\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Using other built-in time functions<\/h2>\n\n\n\n<p>\n  Other built-in functions that may be used for extracting information from times are shown in the table.\n<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>hour<\/strong><\/td><td>Gives the hour in which the time occurs. This uses the 24 hour clock.<\/td><\/tr><tr><td><strong>minute<\/strong><\/td><td>Gives the minute\u2019s part of the time.<\/td><\/tr><tr><td><strong>second<\/strong><\/td><td>Gives the second\u2019s part of the time.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\n  You can build a similar derived variable to categorize replies according to the day of week, regardless of the month or the year, by using the weekday function in a similar way to the way the month function was used in the previous example.\n<\/p>\n\n\n\n<p>\n  If there is a topic you would like a tutorial on, email to <a href=\"mailto:snapideas@snapsurveys.com\" target=\"_self\" rel=\"noopener noreferrer\">snapideas@snapsurveys.com<\/a>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Snap XMP Desktop you can use times to analyze your survey response data. This tutorial explains how to set up the start and end time questions then create variables that calculate the time difference and show how to categorise this information as time bands. Step 1: Creating the time questions Step 2: Creating a [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"epkb_post_type_1_category":[94],"epkb_post_type_1_tag":[],"class_list":["post-5501","epkb_post_type_1","type-epkb_post_type_1","status-publish","hentry","epkb_post_type_1_category-how-to-tutorials-snap-desktop-analyze"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Calculating the time in minutes between two time variables | SnapSurveys<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Calculating the time in minutes between two time variables | SnapSurveys\" \/>\n<meta property=\"og:description\" content=\"With Snap XMP Desktop you can use times to analyze your survey response data. This tutorial explains how to set up the start and end time questions then create variables that calculate the time difference and show how to categorise this information as time bands. Step 1: Creating the time questions Step 2: Creating a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/\" \/>\n<meta property=\"og:site_name\" content=\"SnapSurveys\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/snapsurveys\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-10T14:10:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@snapsurveys\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/\",\"name\":\"Calculating the time in minutes between two time variables | SnapSurveys\",\"isPartOf\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png\",\"datePublished\":\"2021-05-26T09:05:33+00:00\",\"dateModified\":\"2023-10-10T14:10:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#primaryimage\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png\",\"contentUrl\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png\",\"width\":25,\"height\":26,\"caption\":\"NewIcon.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Snap XMP Support\",\"item\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp-archive\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calculating the time in minutes between two time variables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/#website\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/\",\"name\":\"Snap XMP Support Hub\",\"description\":\"Support documentation for Snap Surveys products\",\"publisher\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/#organization\",\"name\":\"Snap Surveys\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2020\/06\/snap-surveys-logo-fc.svg\",\"contentUrl\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2020\/06\/snap-surveys-logo-fc.svg\",\"width\":867,\"height\":159,\"caption\":\"Snap Surveys\"},\"image\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snapxmp\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/snapsurveys\",\"https:\/\/x.com\/snapsurveys\",\"https:\/\/www.linkedin.com\/company\/snapsurveys\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Calculating the time in minutes between two time variables | SnapSurveys","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/","og_locale":"en_GB","og_type":"article","og_title":"Calculating the time in minutes between two time variables | SnapSurveys","og_description":"With Snap XMP Desktop you can use times to analyze your survey response data. This tutorial explains how to set up the start and end time questions then create variables that calculate the time difference and show how to categorise this information as time bands. Step 1: Creating the time questions Step 2: Creating a [&hellip;]","og_url":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/","og_site_name":"SnapSurveys","article_publisher":"https:\/\/www.facebook.com\/snapsurveys","article_modified_time":"2023-10-10T14:10:43+00:00","og_image":[{"url":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@snapsurveys","twitter_misc":{"Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/","url":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/","name":"Calculating the time in minutes between two time variables | SnapSurveys","isPartOf":{"@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#primaryimage"},"image":{"@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png","datePublished":"2021-05-26T09:05:33+00:00","dateModified":"2023-10-10T14:10:43+00:00","breadcrumb":{"@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#primaryimage","url":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png","contentUrl":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2021\/05\/newicon-png-8.png","width":25,"height":26,"caption":"NewIcon.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp\/calculating-time-minutes-time-variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.snapsurveys.com\/support-snapxmp\/"},{"@type":"ListItem","position":2,"name":"Snap XMP Support","item":"https:\/\/www.snapsurveys.com\/support-snapxmp\/snapxmp-archive\/"},{"@type":"ListItem","position":3,"name":"Calculating the time in minutes between two time variables"}]},{"@type":"WebSite","@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/#website","url":"https:\/\/www.snapsurveys.com\/support-snapxmp\/","name":"Snap XMP Support Hub","description":"Support documentation for Snap Surveys products","publisher":{"@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.snapsurveys.com\/support-snapxmp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/#organization","name":"Snap Surveys","url":"https:\/\/www.snapsurveys.com\/support-snapxmp\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/#\/schema\/logo\/image\/","url":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2020\/06\/snap-surveys-logo-fc.svg","contentUrl":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-content\/uploads\/2020\/06\/snap-surveys-logo-fc.svg","width":867,"height":159,"caption":"Snap Surveys"},"image":{"@id":"https:\/\/www.snapsurveys.com\/support-snapxmp\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/snapsurveys","https:\/\/x.com\/snapsurveys","https:\/\/www.linkedin.com\/company\/snapsurveys"]}]}},"_links":{"self":[{"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/epkb_post_type_1\/5501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/epkb_post_type_1"}],"about":[{"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/types\/epkb_post_type_1"}],"author":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/comments?post=5501"}],"version-history":[{"count":6,"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/epkb_post_type_1\/5501\/revisions"}],"predecessor-version":[{"id":10367,"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/epkb_post_type_1\/5501\/revisions\/10367"}],"wp:attachment":[{"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/media?parent=5501"}],"wp:term":[{"taxonomy":"epkb_post_type_1_category","embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/epkb_post_type_1_category?post=5501"},{"taxonomy":"epkb_post_type_1_tag","embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snapxmp\/wp-json\/wp\/v2\/epkb_post_type_1_tag?post=5501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}