{"id":1266,"date":"2020-09-25T15:57:00","date_gmt":"2020-09-25T14:57:00","guid":{"rendered":"https:\/\/microdata.spirehost.no\/?p=1266"},"modified":"2022-02-16T12:59:18","modified_gmt":"2022-02-16T11:59:18","slug":"get-started-the-commands-require-create-dataset-and-import","status":"publish","type":"post","link":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/","title":{"rendered":"Get started \u2013 the commands require, create-dataset and import"},"content":{"rendered":"\n<p><strong>Step 1: Require<\/strong><\/p>\n\n\n\n<p>When logged into the microdata.no workdesk for the first time, or when you start a new session, you are met by an empty screen divided in several areas. In order to import variables, you need to use the command&nbsp;<em>require<\/em>&nbsp;to specify which databank and version to connect to.<\/p>\n\n\n\n<p>Check the button\u00a0<a href=\"https:\/\/microdata.no\/discovery\/\"><strong>Variables<\/strong><\/a>\u00a0on\u00a0<a href=\"https:\/\/www.microdata.no\/\">the main webpage<\/a>\u00a0for a list of available databanks and versions.<\/p>\n\n\n\n<p>A click on a databank returns its complete content and how the versions differ (version log).<\/p>\n\n\n\n<p>This is how you write the command require in the analysis area:<\/p>\n\n\n\n<p>require&nbsp;<em>DATABANKNAME:VERSIONSNUMBER<\/em>&nbsp;as&nbsp;<em>ALIAS<\/em><\/p>\n\n\n\n<p>Example:<\/p>\n\n\n<div id=\"rose-block_620679cb6cb57\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>require no.ssb.fdb:2 as ssb2<\/code><\/pre>\n<\/div>\n\n\n<p>By using the space- or tab-key after typing&nbsp;<code>require<\/code>, a list of available databanks and versions will emerge in a pop-up window (autocomplete-options).<\/p>\n\n\n\n<p>In most cases, one database and one version (Data from Statistics Norway, newest version) is what you need for your session. However, multiple choice is an option, eg. older versions of the same databank or other databanks containing data from other sources (currently not available). You are free to require additional databanks and\/or versions throughout the session.<\/p>\n\n\n\n<p>We recommend aliases for the databanks required, making scripting faster and easier to remember.<\/p>\n\n\n\n<p><strong>Step 2: Create-dataset<\/strong><\/p>\n\n\n\n<p>Having required your data source(s), you need to create your work dataset. You do it with the command&nbsp;<em>create-dataset<\/em>.<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<p>create-dataset&nbsp;<em>NAME_OF_WORK-DATASET<\/em><\/p>\n\n\n\n<p>Example:<\/p>\n\n\n<div id=\"rose-block_620679be6cb56\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>create-dataset test<\/code><\/pre>\n<\/div>\n\n\n<p><strong>Step 3: Import<\/strong><\/p>\n\n\n\n<p>You will find name and other metadata for all variables in the versions you required in the lower left corner of the screen. The variables are connected to their databanks and versions through a prefix, either the original one, or the alias you chose. You must include this prefix when importing the variable.<\/p>\n\n\n\n<p>microdata.no has multiple import commands. The most common is import, used for imports of data measured at a specific date:<\/p>\n\n\n\n<p>Syntax:<\/p>\n\n\n\n<p>import&nbsp;<em>DATABANKNAME(ALIAS)\/VARIABLENAME DATE<\/em>&nbsp;as&nbsp;<em>ALIAS<\/em>&nbsp;(option)<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n<div id=\"rose-block_620679a86cb55\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>import ssb2\/BOSATTEFDT_BOSTED 2015-01-01 as municipality15_v2<\/code><\/pre>\n<\/div>\n\n\n<p>All variables in all required databanks and versions are available for import for all datasets created in the session.<\/p>\n\n\n\n<p>(For importing event variables, we refer to the full&nbsp;<a href=\"https:\/\/www.microdata.no\/wp-content\/uploads\/2021\/12\/User-manual.pdf\">manual<\/a>.)<\/p>\n\n\n\n<p>A script example:<\/p>\n\n\n<div id=\"rose-block_6206797e6cb54\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>require no.ssb.fdb:2 as ssb2\r\nrequire no.ssb.fdb:1 as ssb1\r\ncreate-dataset test\r\nimport ssb2\/BEFOLKNING_KJOENN as sex_V2\r\nimport ssb1\/BEFOLKNING_KJOENN as sex_V1<\/code><\/pre>\n<\/div>\n\n\n<p>Note: You may run&nbsp;<em>require<\/em>&nbsp;before or after&nbsp;<em>create-dataset<\/em>, but import is only possible after minimum one require.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1: Require When logged into the microdata.no workdesk for the first time, or when you start a new session, you are met by an empty screen divided in several areas. In order to import variables, you need to use the command&nbsp;require&nbsp;to specify which databank and version to connect to. Check the button\u00a0Variables\u00a0on\u00a0the main webpage\u00a0for&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-1266","post","type-post","status-publish","format-standard","hentry","category-news"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get started \u2013 the commands require, create-dataset and import - microdata.no<\/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.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get started \u2013 the commands require, create-dataset and import - microdata.no\" \/>\n<meta property=\"og:description\" content=\"Step 1: Require When logged into the microdata.no workdesk for the first time, or when you start a new session, you are met by an empty screen divided in several areas. In order to import variables, you need to use the command&nbsp;require&nbsp;to specify which databank and version to connect to. Check the button\u00a0Variables\u00a0on\u00a0the main webpage\u00a0for...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/\" \/>\n<meta property=\"og:site_name\" content=\"microdata.no\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-25T14:57:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-16T11:59:18+00:00\" \/>\n<meta name=\"author\" content=\"Svein Johansen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Svein Johansen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/\"},\"author\":{\"name\":\"Svein Johansen\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#\\\/schema\\\/person\\\/9054d4c7026e9904fc6cd9ea34dc308d\"},\"headline\":\"Get started \u2013 the commands require, create-dataset and import\",\"datePublished\":\"2020-09-25T14:57:00+00:00\",\"dateModified\":\"2022-02-16T11:59:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/\"},\"wordCount\":384,\"articleSection\":[\"News\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/\",\"name\":\"Get started \u2013 the commands require, create-dataset and import - microdata.no\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\"},\"datePublished\":\"2020-09-25T14:57:00+00:00\",\"dateModified\":\"2022-02-16T11:59:18+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#\\\/schema\\\/person\\\/9054d4c7026e9904fc6cd9ea34dc308d\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/get-started-the-commands-require-create-dataset-and-import\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get started \u2013 the commands require, create-dataset and import\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/\",\"name\":\"microdata.no\",\"description\":\"Gj\u00f8r det enklere \u00e5 analysere registerdata\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.microdata.no\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#\\\/schema\\\/person\\\/9054d4c7026e9904fc6cd9ea34dc308d\",\"name\":\"Svein Johansen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5f41c4700934635e105098fe2eb7db4d7b61093caec9e999e30d3f3c84622276?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5f41c4700934635e105098fe2eb7db4d7b61093caec9e999e30d3f3c84622276?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5f41c4700934635e105098fe2eb7db4d7b61093caec9e999e30d3f3c84622276?s=96&d=mm&r=g\",\"caption\":\"Svein Johansen\"},\"url\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/author\\\/svein\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get started \u2013 the commands require, create-dataset and import - microdata.no","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.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/","og_locale":"en_US","og_type":"article","og_title":"Get started \u2013 the commands require, create-dataset and import - microdata.no","og_description":"Step 1: Require When logged into the microdata.no workdesk for the first time, or when you start a new session, you are met by an empty screen divided in several areas. In order to import variables, you need to use the command&nbsp;require&nbsp;to specify which databank and version to connect to. Check the button\u00a0Variables\u00a0on\u00a0the main webpage\u00a0for...","og_url":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/","og_site_name":"microdata.no","article_published_time":"2020-09-25T14:57:00+00:00","article_modified_time":"2022-02-16T11:59:18+00:00","author":"Svein Johansen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Svein Johansen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/#article","isPartOf":{"@id":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/"},"author":{"name":"Svein Johansen","@id":"https:\/\/www.microdata.no\/#\/schema\/person\/9054d4c7026e9904fc6cd9ea34dc308d"},"headline":"Get started \u2013 the commands require, create-dataset and import","datePublished":"2020-09-25T14:57:00+00:00","dateModified":"2022-02-16T11:59:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/"},"wordCount":384,"articleSection":["News"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/","url":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/","name":"Get started \u2013 the commands require, create-dataset and import - microdata.no","isPartOf":{"@id":"https:\/\/www.microdata.no\/#website"},"datePublished":"2020-09-25T14:57:00+00:00","dateModified":"2022-02-16T11:59:18+00:00","author":{"@id":"https:\/\/www.microdata.no\/#\/schema\/person\/9054d4c7026e9904fc6cd9ea34dc308d"},"breadcrumb":{"@id":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microdata.no\/en\/get-started-the-commands-require-create-dataset-and-import\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/www.microdata.no\/en\/"},{"@type":"ListItem","position":2,"name":"Get started \u2013 the commands require, create-dataset and import"}]},{"@type":"WebSite","@id":"https:\/\/www.microdata.no\/#website","url":"https:\/\/www.microdata.no\/","name":"microdata.no","description":"Gj\u00f8r det enklere \u00e5 analysere registerdata","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microdata.no\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.microdata.no\/#\/schema\/person\/9054d4c7026e9904fc6cd9ea34dc308d","name":"Svein Johansen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5f41c4700934635e105098fe2eb7db4d7b61093caec9e999e30d3f3c84622276?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5f41c4700934635e105098fe2eb7db4d7b61093caec9e999e30d3f3c84622276?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5f41c4700934635e105098fe2eb7db4d7b61093caec9e999e30d3f3c84622276?s=96&d=mm&r=g","caption":"Svein Johansen"},"url":"https:\/\/www.microdata.no\/en\/author\/svein\/"}]}},"taxonomy_info":{"category":[{"value":2,"label":"News"}]},"featured_image_src_large":false,"author_info":{"display_name":"Svein Johansen","author_link":"https:\/\/www.microdata.no\/en\/author\/svein\/"},"comment_info":0,"category_info":[{"term_id":2,"name":"News","slug":"news","term_group":0,"term_taxonomy_id":2,"taxonomy":"category","description":"","parent":0,"count":79,"filter":"raw","cat_ID":2,"category_count":79,"category_description":"","cat_name":"News","category_nicename":"news","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts\/1266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/comments?post=1266"}],"version-history":[{"count":6,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts\/1266\/revisions"}],"predecessor-version":[{"id":1357,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/posts\/1266\/revisions\/1357"}],"wp:attachment":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/media?parent=1266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/categories?post=1266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/tags?post=1266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}