Hi
I have a dashboard which compares two dates as below,assuming date 1 and Date2 as From date and today.I need From date to be defaulted to Previous day[today -1] and to date to be defaulted to Previous day -1.And user can have preference to change the dates .Please suggest
Lavanya,
Good learning opportunity.
Several steps, but please be patient.
1. Get (Today -1) data
[Date Header]
if [Date]<today()then[Date] end
[Date_Header exclude NULL] // same as [Date Header], but need duplicate to eliminate "null" from filter list
if [Date]<today()then[Date] end
[Date-1] // used later.
[Date]-1
[Date_Header exclude NULL] is used to eliminate "Null" from Header filter list
Put [Date Header] to filter shelf and quick filter.
Edit [Date Header] filter
To eliminate "Null", check "Only relevant Value"
To keep today-1 as default, put "Top 1" of Max date of [Date Header]
2. Get previous day data
Duplicate Data source
On 2nd datasource,
Rename the [Date] field to [Date_Original]
Create [Date] field as calculated field
[Date]
[Date-original]-1
Link primary data source [Date] and 2nd data source [Date] // because field name is same, it's automatically prepared. just turn on "Chain" to orange.
In this sample case, need to link "Company" as well.
Set field as below. // Only Measure value from 2nd data source, no dimension from 2nd.
On Primary data source,
Put calculated field for delta
[Delta] // (added comment later : This Delta calc is opposite, please correct in your side)SUM([Clipboard_20160210T104724 (copy)].[TTL])-sum([TTL])
Thanks,
Shin
9.0 attached.