XLCubed is now FluenceXL. The new wiki can be found here: https://help.fluencexl.com/

Difference between revisions of "Date Slicer"

Line 1: Line 1:
Date Slicers can be based on an Excel range, or direct from SQL. This example shows you how to use it from Excel, but a SQL statement which returns the same result set format can also be used.
+
Date Slicers can be based on an Excel range, or direct from SQL. The example below demonstrates how to use a date slicer from an Excel range, but a SQL statement which returns the same result set format can also be used.
  
The first thing to do is to set up two Excel cells to hold the date range.  We have a start date and an end date in cell locations B1 and B2 as below:
+
==Creating a Date Slicer==
 +
 
 +
To create a date slicer, you will first need two Excel cells to hold the date range (start and end date).
 +
 
 +
[[Image:Dateslicer.PNG|centre]]
 
   
 
   
[[Image:ds1b.png|150px|centre]]
+
Create an Excel slicer from the Slicer ribbon item:
  
Next you insert an Excel slicer from the Slicer tab
+
[[Image:Dateslicer1.PNG|centre]]
 
   
 
   
[[Image:ds2a.png|225px|centre]]
+
Set the Slicer Range to point to the start date and end date (cells B1:B2 in this example) and select the Date Slicer type. 
 +
 
 +
[[Image:Dateslicer3.PNG|350px|centre]]
  
You will see Insert Slicer Window displayed.
+
Under the Behaviour tab, select the cell where you wish the slicer selection to be stored. The date selected is displayed as the serial number equivalent so that the user can then choose to format the date as they need.  
  
Set the Slicer Range to point to the Start Date and End Date (cells B1:B2 in this example)
+
[[Image:Dateslicer4.PNG|350px|centre]]
  
Select the Date Slicer type
+
The date slicer will then be inserted, with the drop down opening a calendar control which can be navigated between the specified start and end dates.
  
Check the box to Update Range With Selection and enter a cell location.  This will be where the date selected will be held.
+
[[Image:Dateslicer5.PNG|250px|centre]]
The date selected is displayed as the serial number equivalent so that the user can then choose to format the date as they need.  
 
  
[[Image:ds3.png|350px|centre]]
+
==Using a Date Slicer to Drive a Report==
  
Click OK to exit.
+
Click a date to select it and it will be written as the Excel serial numberin the cell location defined in Update Range With Selection.
  
Click the drop-down on the slicer and XLCubed will display a calendar control which can be navigated between the specified start and end dates.
+
You can choose to format this by using the Excel TEXT function eg =TEXT(C4, "dd-mm-yyyy").
+
 
[[Image:ds4a.png|250px|centre]]
+
A grid can then be driven from this cell as described [[Driving Grids from an Excel Range|here]].
 +
 
 +
==Customising the Calendar==
 +
 
 +
===Day, Month or Year View===
  
Click a date to select it and it will be written as the Excel serial number equivalent to the cell location defined in Update Range With Selection.   
+
You can include a third cell in your Slicer Range as the ''Selection Type'' i.e. Day, Month or YearValid selections are D, M or Y.
  
You can then choose to format this by using the Excel TEXT function eg =TEXT(E1,"dd-mm-yyyy").
+
Day is taken to be the default selection type and is the default display mode if no selection type if specified.
  
You can also include a third cell in your Slicer Range as Selection Type eg Day, Month or Year.  Valid selections are D, M or Y. Day is taken to be the default selection type and is the default display mode if no selection type if specified.
+
[[Image:Dateslicer10.PNG|500px|centre]]
  
So let's change the slicer range to also include B3 (which holds our selection type) and click OK.
+
The calendar now displays the month view.
  
[[Image:ds8.png|250px|centre]]
+
[[Image:Dateslicer11.PNG|250px|centre]]
  
Set B3 to M and now when you click the drop-down box you will be be able to pick only months between the range specified.
+
===Initial Selection===
  
[[Image:ds5.png|350px|centre]]
+
As with any slicer, you can select which value will initially be displayed ( see [[Dimension Slicers#Initial Value|Dimension Slicers]]).
  
Similarly change the type to D for day and Y for Y:
+
Selecting the Initial Value as the ''Default Member'' for a date slicer gives today's date. This means when the report is first opened, it displays today's data, from which you can navigate using the date slicer.
  
[[Image:ds6.png|350px]] [[Image:ds7.png|350px]]
+
[[Image:Dateslicer12.PNG|350px|center]]
  
 
<br clear="all" />
 
<br clear="all" />

Revision as of 12:08, 9 January 2018

Date Slicers can be based on an Excel range, or direct from SQL. The example below demonstrates how to use a date slicer from an Excel range, but a SQL statement which returns the same result set format can also be used.

Creating a Date Slicer

To create a date slicer, you will first need two Excel cells to hold the date range (start and end date).

Dateslicer.PNG

Create an Excel slicer from the Slicer ribbon item:

Dateslicer1.PNG

Set the Slicer Range to point to the start date and end date (cells B1:B2 in this example) and select the Date Slicer type.

Dateslicer3.PNG

Under the Behaviour tab, select the cell where you wish the slicer selection to be stored. The date selected is displayed as the serial number equivalent so that the user can then choose to format the date as they need.

Dateslicer4.PNG

The date slicer will then be inserted, with the drop down opening a calendar control which can be navigated between the specified start and end dates.

Dateslicer5.PNG

Using a Date Slicer to Drive a Report

Click a date to select it and it will be written as the Excel serial numberin the cell location defined in Update Range With Selection.

You can choose to format this by using the Excel TEXT function eg =TEXT(C4, "dd-mm-yyyy").

A grid can then be driven from this cell as described here.

Customising the Calendar

Day, Month or Year View

You can include a third cell in your Slicer Range as the Selection Type i.e. Day, Month or Year. Valid selections are D, M or Y.

Day is taken to be the default selection type and is the default display mode if no selection type if specified.

Dateslicer10.PNG

The calendar now displays the month view.

Dateslicer11.PNG

Initial Selection

As with any slicer, you can select which value will initially be displayed ( see Dimension Slicers).

Selecting the Initial Value as the Default Member for a date slicer gives today's date. This means when the report is first opened, it displays today's data, from which you can navigate using the date slicer.

Dateslicer12.PNG


See Also