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

Difference between revisions of "Date Slicer"

(Using a Date Slicer to Drive a Report)
 
(10 intermediate revisions by 4 users not shown)
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]]
 +
 
 +
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.
 +
 
 +
[[Image:Dateslicer4.PNG|350px|centre]]
 +
 
 +
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.
 +
 
 +
[[Image:Dateslicer5.PNG|250px|centre]]
 +
 
 +
==Using a Date Slicer to Drive a Report==
 +
 
 +
Click a date to select it and it will be written as the Excel serial number in 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 [[Driving Grids from an Excel Range|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.
  
You will see Insert Slicer Window displayed.
+
[[Image:Dateslicer10.PNG|500px|centre]]
Set the Slicer Range to point to the Start Date and End Date (cells B1:B2 in this example)
 
Select the Date Slicer type
 
Check the box to Update Range With Selection and enter a cell location.  This will be where the date selected will be held.
 
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]]
+
The calendar now displays the month view.
  
Click OK to exit.
+
[[Image:Dateslicer11.PNG|250px|centre]]
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.
+
 
+
===Initial Selection===
[[Image:ds4a.png|250px|centre]]
+
 
 +
As with any slicer, you can select which value will initially be displayed ( see [[Dimension Slicers#Initial Value|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.
 +
 
 +
[[Image:Dateslicer12.PNG|350px|center]]
 +
 
 +
<br clear="all" />
 +
 
 +
==See Also==
 +
* [[Dimension Slicers]]
 +
* [[Excel Range Slicers]]
  
Click a date to select it and it will be written as Excel’s serial number equivalent to the cell location defined in Update Range With Selection.  You can then choose to format this by using Excel’s TEXT function eg =TEXT(E1,"dd-mm-yyyy").
+
[[Category:Slicers]]

Latest revision as of 12:12, 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 number in 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