{"id":1597,"date":"2015-02-18T01:26:17","date_gmt":"2015-02-17T17:26:17","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=1597"},"modified":"2017-12-14T14:35:30","modified_gmt":"2017-12-14T06:35:30","slug":"month-picker-4-3-2","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/month-picker\/month-picker-4-3-2\/","title":{"rendered":"Month Picker (4.3.2)"},"content":{"rendered":"<p class=\"left-bar\">This article applies to versions 4.3.2 and earlier of P2 Explorer. For help on the latest version of the month picker, see <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/month-picker\/\">Month Picker<\/a>.<\/p>\n<p class=\"note\">This article describes how to add a Month Picker\u00a0control to a page during the page design process. For details on how to use the Month Picker\u00a0during run time, see: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/using-the-page-controls\/using-time-pickers\/\">Using Time Pickers<\/a>.<\/p>\n\n<h3 class=\"page-subheading\">Overview<\/h3>\n<p class=\"intro-text\">The Month\u00a0Picker allows a user select a monthly time period. This is usually used to provide a time period for other components\u00a0on the page, such as a chart. The component publishes the start and end of the month period for use by other components.<\/p>\n<p class=\"intro-text\">The following diagram shows a Month\u00a0Picker component\u00a0being configured:<\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpicker.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2924 size-full\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpicker.png\" alt=\"\" width=\"755\" height=\"431\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpicker.png 755w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpicker-150x86.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpicker-24x14.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpicker-36x21.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpicker-48x27.png 48w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/a><\/p>\n<div style=\"position: relative;\">\u00a0<\/div>\n<table>\n<tbody>\n<tr>\n<td width=\"130\"><strong>Start Time<\/strong>:<\/td>\n<td>The start of the month\u00a0that is initially displayed when the page first loads.\u00a0This must be created as an <a title=\"Events\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/events\/\">event<\/a> with a type of <em>Datetime<\/em>. You can choose a date and time using the date picker. You can choose the date and time separately, however it\u2019s normally used to specify a time period starting from midnight.<\/td>\n<\/tr>\n<tr>\n<td width=\"130\"><strong>End Time<\/strong><\/td>\n<td>The end of the time\u00a0range that is initially displayed when the page first loads.\u00a0This must also be created as an <a title=\"Page Events\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/events\/\">event<\/a> with a type of <em>Datetime<\/em>. This should be no later\u00a0than the end of the month specified as the start date.\u00a0If this is past the end of the month from the start date, the end date is ignored and defaults to the end of the month.<\/td>\n<\/tr>\n<tr>\n<td width=\"130\"><strong>Month<\/strong><\/td>\n<td>The month that is selected by default when the page first loads. This must be created as an <a title=\"Events\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/events\/\">event<\/a> with a type of <em>Number<\/em>, with the number corresponding to the month.<\/td>\n<\/tr>\n<tr>\n<td width=\"130\"><strong>Year<\/strong><\/td>\n<td>The year that is selected by default when the page first loads. If no year is specified, the current year is used. This must be created as an <a title=\"Events\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/events\/\">event<\/a> with a type of <em>Number<\/em>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<hr \/>\n<h3 class=\"page-subheading\">Tutorial<\/h3>\n<p class=\"intro-text\">The Month Picker is a useful component\u00a0that enables users to change the type of data that is returned to other components\u00a0on a page.<\/p>\n<p class=\"intro-text\">In this tutorial, we'll look at adding a Month\u00a0Picker that will change what is displayed on a chart as the user selects different months.<\/p>\n<p class=\"intro-text\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2156\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart.png\" alt=\"timeperiodpickerchart\" width=\"387\" height=\"338\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart.png 387w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-150x131.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-24x21.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-36x31.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-48x42.png 48w\" sizes=\"auto, (max-width: 387px) 100vw, 387px\" \/><\/p>\n<p class=\"intro-text\">Let's go through this process, step-by-step.<\/p>\n<hr \/>\n<h3 class=\"page-subheading\">Step by Step: Creating a Month\u00a0Picker that Drives a Stacked Chart<\/h3>\n<p class=\"intro-text\">Before you start, open a new tab in Explorer and click the \u201cCreate a New Page in Studio Mode\u201d thumbnail. Choose the <a title=\"Grid Layout\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/grid-layout\/\">grid<\/a>\u00a0layout - you can adjust the rows and columns if you like but it's not important for this exercise.<\/p>\n<p class=\"intro-text\">If you have access to the training environment, you can follow the steps exactly as outlined here. Otherwise, you will need to adjust the configuration to suit your data.<\/p>\n<p class=\"intro-text\"><strong>Step 1. Add the Month\u00a0Picker to the page<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpickerdrag.png\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2926 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpickerdrag-800x384.png\" alt=\"\" width=\"800\" height=\"384\" \/><\/a><\/p>\n<p class=\"intro-text\">Drag and drop the Month\u00a0Picker component\u00a0onto a grid cell.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\">\u00a0<strong>Step 2.\u00a0\u00a0Configure the Month\u00a0Picker<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpickerconfig.png\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2927 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpickerconfig-800x464.png\" alt=\"\" width=\"800\" height=\"464\" \/><\/a><\/p>\n<p class=\"intro-text\">The Month\u00a0Picker uses events to configure all its options. In fact, you'll notice that the\u00a0events all come preconfigured with event names. This is because these events are so often used, and by other components\u00a0on the page, that it's often unnecessary to bother changing the names. It's best to leave the names as is, but you can change them if you want. If you do change them, you'll need to remember this for the next steps.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\"><strong>Step 3.\u00a0\u00a0Create the events<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpickerevents.png\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2928 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/monthpickerevents-800x468.png\" alt=\"\" width=\"800\" height=\"468\" \/><\/a><\/p>\n<p class=\"intro-text\">This step provides the hooks for the Month\u00a0Picker to send signals to other components\u00a0on the page.<\/p>\n<ul class=\"intro-text\">\n<li>Click the <em><strong>Set Defaults<\/strong><\/em> button on the far right of the Studio toolbar.<\/li>\n<li>\u00a0Create\u00a0an event called <em>\"startTime\"<\/em>\u00a0with a date set to 1 January 2014.<\/li>\n<li>Create an event called <em>\"endTime\"<\/em> with a date set to 31 December 2014.<\/li>\n<li>Create an event called <em>\"selectedMonth\"<\/em> with a number value of 1.<\/li>\n<li>Create an event called <em>\"selectedYear\"<\/em> with a number value of 2014.<\/li>\n<\/ul>\n<p class=\"intro-text\">You can create an\u00a0<a title=\"Page Events\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/events\/\">event<\/a> at any time. In creating these events, we make them available not only to the Month\u00a0Picker, but also to any other components\u00a0we may want to place on the page.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\"><strong>Step 4. Add and configure data<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerdata.png\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2159 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerdata-732x600.png\" alt=\"timeperiodpickerdata\" width=\"732\" height=\"600\" \/><\/a><\/p>\n<p class=\"intro-text\">Month\u00a0Pickers don't normally do anything by themselves - you use them to drive other components.\u00a0Ultimately, we want the Month Picker to change the returned data depending on what time period the user selects. Let's add some data\u00a0that we will use to return <a title=\"Add a Relational Dataset\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/add-data\/add-a-dataset\/\">data<\/a> to a chart.<\/p>\n<ul class=\"intro-text\">\n<li>Add the <em>AccountingAmountbyProduct<\/em> dataset, and configure it as follows:\n<ul class=\"intro-text\">\n<li>periodEndedYear: (Event) selectedYear<\/li>\n<li>periodEndedMonth: (Event) selectedMonth<\/li>\n<li>PeriodType: (Text) Accounting<\/li>\n<li>amountType:\u00a0(Text) Net<\/li>\n<li>accountMultiple: (Number) -1<\/li>\n<li>reportingLevel:\u00a0(Text) AREA<\/li>\n<li>currencyCode:\u00a0(Text) CAD<\/li>\n<li>accountType:\u00a0(Text) RV<\/li>\n<li>entitySelectedFlag:\u00a0(Text) N<\/li>\n<li>selectedHierarchyId:\u00a0(Text) All<\/li>\n<li>selectedEntities: (List) FIREBAG, GARDEN, GLACIER, BADGER, KIRBY, KAYBOB<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"intro-text\">As you can see, you need a degree of familiarity with the dataset to know what the parameters mean. In this dataset, we have 2 parameters that can listen to events published by the Month\u00a0Picker: <strong>periodEndedYear<\/strong> and <strong>periodEndedMonth.<\/strong> This is what ultimately causes the chart to change when the user selects different months.<\/p>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\"><strong>Step 5. Add and configure the chart<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchartconfig.png\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2163 size-large\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchartconfig-590x600.png\" alt=\"timeperiodpickerchartconfig\" width=\"590\" height=\"600\" \/><\/a><\/p>\n<p class=\"intro-text\">Let's add a <a title=\"Charts\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/charts\/\">chart<\/a>\u00a0that will make use of the Month\u00a0Picker. Drag and drop a Chart\u00a0onto another cell on the page. Configure a\u00a0<a title=\"Stacked Bar Chart\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/charts\/\">stacked bar chart<\/a> as follows:<\/p>\n<ul class=\"intro-text\">\n<li>Source Data:\u00a0AccountingAmountbyProduct1<\/li>\n<li>For the chart series:\n<ul class=\"intro-text\">\n<li>Type: Stacked Bar series<\/li>\n<\/ul>\n<\/li>\n<li>Add 3 Bar Series, configured the first as follows:\n<ul class=\"intro-text\">\n<li>Y Field: (Text)\u00a0OIL<\/li>\n<li>Name: (Text)\u00a0Oil Sales<\/li>\n<li>Colour: (Text)\u00a0#9BBB59<\/li>\n<\/ul>\n<\/li>\n<li>Configure the 2nd bar series as follows:\n<ul class=\"intro-text\">\n<li>Y Field: (Text)\u00a0GAS<\/li>\n<li>Name: (Text) Gas\u00a0Sales<\/li>\n<li>Colour: (Text)\u00a0#C0504D<\/li>\n<\/ul>\n<\/li>\n<li>Configure the 3rd bar series as follows:\n<ul class=\"intro-text\">\n<li>Y Field: (Text)\u00a0NGL<\/li>\n<li>Name: (Text) NGL\u00a0Sales<\/li>\n<li>Colour: (Text)\u00a0#8064A2<\/li>\n<\/ul>\n<\/li>\n<li>For the X Axis:\n<ul class=\"intro-text\">\n<li>Field: (Text)\u00a0DISPLAY_MONTH<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p class=\"intro-text\">\u00a0<\/p>\n<p class=\"intro-text\">\u00a0<strong>Step 6. All done!\u00a0\u00a0<\/strong><\/p>\n<p class=\"intro-text\"><a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart.png\" rel=\"lightbox-6\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2156 size-full\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart.png\" alt=\"timeperiodpickerchart\" width=\"387\" height=\"338\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart.png 387w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-150x131.png 150w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-24x21.png 24w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-36x31.png 36w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/timeperiodpickerchart-48x42.png 48w\" sizes=\"auto, (max-width: 387px) 100vw, 387px\" \/><\/a><\/p>\n<p class=\"intro-text\">Congratulations! You now have a fully functioning Month Picker\u00a0that drives a stacked bar chart.<\/p>\n<ul class=\"intro-text\">\n<li>Click the preview\u00a0<a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/preview.png\" rel=\"lightbox-7\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2896\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/03\/preview.png\" alt=\"preview\" width=\"13\" height=\"14\" \/><\/a>\u00a0button on the Studio toolbar to see what your page will look like in run-time.<\/li>\n<li>When the Month Picker\u00a0first loads, the chart displays data for the corresponding default period.<\/li>\n<\/ul>\n<p class=\"intro-text\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1348\" src=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save.png\" alt=\"save\" width=\"48\" height=\"53\" srcset=\"https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save.png 48w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save-22x24.png 22w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save-33x36.png 33w, https:\/\/oihelp.corporate.ifs.com\/help\/wp-content\/uploads\/2015\/02\/save-43x48.png 43w\" sizes=\"auto, (max-width: 48px) 100vw, 48px\" \/>\u00a0Don't forget to <a title=\"Saving Your Page\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-create-your-first-page\/saving-your-page\/\">save your page<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Month Picker allows a user select a monthly time period. This is usually used to provide a time period for other components on the page, such as a chart. The component publishes the start and end of the month period for use by other components. This article describes how to add a Month Picker control to a page during the page design process, in versions 4.3.2 and earlier of P2 Explorer. <\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-explorer\/explorer-studio\/controls\/month-picker\/month-picker-4-3-2\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":4497,"parent":13134,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[11],"tags":[348],"class_list":["post-1597","page","type-page","status-publish","has-post-thumbnail","hentry","category-tutorial","tag-date-and-time-pickers","Product-ex"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/1597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=1597"}],"version-history":[{"count":0,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/1597\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/13134"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/4497"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=1597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=1597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=1597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}