{"id":4704,"date":"2012-10-10T16:53:38","date_gmt":"2012-10-10T16:53:38","guid":{"rendered":"https:\/\/www.snapsurveys.com\/support-snap11\/?page_id=4704"},"modified":"2018-10-04T14:37:12","modified_gmt":"2018-10-04T13:37:12","slug":"analyzing-dates","status":"publish","type":"page","link":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/","title":{"rendered":"Analysing Dates"},"content":{"rendered":"<p>Snap includes a number of operations and functions specifically designed for help in analysing analyzingdates.<\/p>\n<p>In Snap questionnaires, respondents reply to Date-response questions by entering a free-form date such as &#8220;July 1st, 2004&#8221; or &#8220;1 Jul 04&#8221;. Snap&#8217;s inbuilt operations enable those to be categorized by month, by day of the week or broken down into arbitrary ranges.<\/p>\n<p>Given a date question, say, Q1 &#8220;When did you last visit?&#8221;, comparison operations may be used to construct a derived variable which categorizes the response into quarters of the year.<\/p>\n<h3>Step By Step<\/h3>\n<div>\n<h3>Step 1<\/h3>\n<p>Create a new variable called Quarter by going into the variables window \u2013 View | Variables | click the + icon to insert a new variable.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-25010\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2017\/03\/ws6_f1v2.gif\" alt=\"Variable Details | Quarter\" width=\"400\" height=\"279\" srcset=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2017\/03\/ws6_f1v2.gif 400w, https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2017\/03\/ws6_f1v2-150x105.gif 150w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<\/div>\n<div>\n<h3>Step 2<\/h3>\n<p>Set the Type to Derived and Response to Single.<\/p>\n<\/div>\n<div>\n<h3>Step 3<\/h3>\n<p>For the first quarter, specify the appropriate range of dates:<\/p>\n<p>Q1 &gt;= 1 Jan 04 and Q1 &lt; 1 Apr 04<\/p>\n<p>Any appropriate date format can be used to specify the fixed dates your are checking against.<\/p>\n<p>In some circumstances, it is possible to simplify the specification. For this example we could have used Snap&#8217;s in-built month function to give us a number representing the month of the year (1=January, 12=December). Using that, we can set up the codes of the categorizing variable as follows:<\/p>\n<table cellspacing=\"0\">\n<tbody>\n<tr>\n<th>Label<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>First Quarter<\/td>\n<td>Q1 month &lt;= 3<\/td>\n<\/tr>\n<tr>\n<td>Second Quarter<\/td>\n<td>Q1 month &lt;= 6<\/td>\n<\/tr>\n<tr>\n<td>Third Quarter<\/td>\n<td>Q1 month &lt;= 9<\/td>\n<\/tr>\n<tr>\n<td>Fourth Quarter<\/td>\n<td>Q1 month &lt;= 12<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We have simplified the specification by using the <strong>month<\/strong> function and by taking advantage of the fact that for a <strong>derived single<\/strong> variable, we only need to specify the upper bound for each code value (any respondent in the previous code will already have been captured by that code). Also note that this version will work regardless of the year the survey was conducted in.<\/p>\n<p>Other built-in functions that may be used for extracting information from dates are:<\/p>\n<p><strong>Q1 weekday<\/strong> will give the day of the week (1=Monday, 7=Sunday)<br \/>\n<strong>Q1 weekday name<\/strong> will give a literal representing the name of the weekday (e.g. &#8220;Wednesday&#8221;)<br \/>\n<strong>Q1 day<\/strong> will give the day of the month (1 to 28, 29, 30 or 31 as appropriate)<br \/>\n<strong>Q1 month<\/strong> will give the month of the year (1=January, 12=December)<br \/>\n<strong>Q1 month name<\/strong> will give the name of the month (e.g. &#8220;July&#8221;)<br \/>\n<strong>Q1 year<\/strong> will give the four-digit year (e.g. 2004)<\/p>\n<p>So it would be possible to 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 our month function was used in the previous example.<\/p>\n<\/div>\n<p>If there is a topic you would like a worksheet on, email to <a title=\"\" href=\"mailto:snapideas@snapsurveys.com\" target=\"_self\">snapideas@snapsurveys.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><a class=\"ninja_pages_read_more\"  href=\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/\"><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"parent":43,"menu_order":129,"comment_status":"open","ping_status":"closed","template":"page-templates\/child-page.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":{"0":"post-4704","1":"page","2":"type-page","3":"status-publish","5":"search_category-support-hub"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Analysing Dates - Snap Surveys<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Analysing Dates - Snap Surveys\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/\" \/>\n<meta property=\"og:site_name\" content=\"Snap Surveys\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SnapSurveys\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-04T13:37:12+00:00\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/\",\"name\":\"Analysing Dates - Snap Surveys\",\"isPartOf\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/#website\"},\"datePublished\":\"2012-10-10T16:53:38+00:00\",\"dateModified\":\"2018-10-04T13:37:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.snapsurveys.com\/support-snap11\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Worksheets\",\"item\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Analysing Dates\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/#website\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snap11\/\",\"name\":\"Snap Surveys\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.snapsurveys.com\/support-snap11\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Analysing Dates - Snap Surveys","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_GB","og_type":"article","og_title":"Analysing Dates - Snap Surveys","og_url":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/","og_site_name":"Snap Surveys","article_publisher":"https:\/\/www.facebook.com\/SnapSurveys","article_modified_time":"2018-10-04T13:37:12+00:00","twitter_card":"summary_large_image","twitter_site":"@snapsurveys","twitter_misc":{"Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/","url":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/","name":"Analysing Dates - Snap Surveys","isPartOf":{"@id":"https:\/\/www.snapsurveys.com\/support-snap11\/#website"},"datePublished":"2012-10-10T16:53:38+00:00","dateModified":"2018-10-04T13:37:12+00:00","breadcrumb":{"@id":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/analyzing-dates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.snapsurveys.com\/support-snap11\/"},{"@type":"ListItem","position":2,"name":"Worksheets","item":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/"},{"@type":"ListItem","position":3,"name":"Analysing Dates"}]},{"@type":"WebSite","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/#website","url":"https:\/\/www.snapsurveys.com\/support-snap11\/","name":"Snap Surveys","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.snapsurveys.com\/support-snap11\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/4704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/comments?post=4704"}],"version-history":[{"count":10,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/4704\/revisions"}],"predecessor-version":[{"id":26612,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/4704\/revisions\/26612"}],"up":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/43"}],"wp:attachment":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/media?parent=4704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}