Overview
Preview
For example, it is necessary to dynamically display the number of daily new stores in different regions.
Implementation Method
Filter Detail of indicators and Date Filter Component are connected through parameters:
Create a calculation indicator that calculates the difference between two indicator fields.
The first date filter component controls an indicator field to filter out the number of stores for the current day.
The second date filter component controls an indicator field to filter out the total number of stores for the previous day and the current day.
Procedures
Example data: Calculating the Number of New Stores Dynamically.xlsx
Adding a Component
1. Upload the downloaded example data to Public Data in FineBI. Select the uploaded example data, click Create Analysis Subject, rename it as Calculating the Number of New Stores Dynamically, and select the location to be placed.
2. Click Component to go to the component editing interface.
Adding Indicators
1. Go to the component editing interface and copy the store field twice.
2. Click Convert to Indicator to convert the copied Store1 and Store2 fields into indicators.
3. Then you can get the number of stores for deduplication counting. Rename Store1 as Number of stores for the current day and rename Store2 as Number of stores for the previous day and the current day.
Calculating the Number of New Stores
Add a calculation indicator and rename the field Number of new stores. Number of new stores = Number of stores for the previous day and the current day - Number of stores for the current day
Adding Time Type Parameters
Add two time type parameters.
Setting Indicators Binding Parameters
To dynamically display the number of stores for the current day, you need to establish a connection between the indicator and date filter components through parameters.
1. Bind Number of stores for the current day to Parameter and set the filter condition to the same step length.
2. Bind Number of stores for the previous day and the current day to Parameter1 and set the filter condition to same step length.
Creating a Table
Drag the corresponding fields into Dimensions and Indicators.
Filter Components Binding Parameters
2. Click Add Dashboard and drag the created component into the dashboard.
3. Drag Date Interval Filter Component into the dashboard, tick Bind Parameter, click , and tick Parameter.
3. Drag Date Interval Filter Component into the dashboard, tick Bind Parameter, click , and tick Parameter1.
4. Set the filter time of Date Interval to 2020/01/01, and the filter time of Date Interval 1 to being from 2020/01/01 to 2020/01/02 (the total number of stores for the current day and the previous day). At this time, the Number of new stores field will automatically display the filtered number of new store for the current day.
Demonstration
For details, see section "Preview".