Skip to main content

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

 

Default date1 to Previous day and Date 2 to Previous day -1

15 answers
  1. Feb 10, 2016, 6:16 PM

    Lavanya,

     

    Good learning opportunity.

    Several steps, but please be patient.

     

    Lavanya, Good learning opportunity.Several steps, but please be patient. 1.

     

    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

     

    pastedImage_1.png

    [Date_Header exclude NULL] is used to eliminate "Null" from Header filter list

    pastedImage_2.png

    Put [Date Header] to filter shelf and quick filter.

    pastedImage_3.png

     

    Edit [Date Header] filter

    To eliminate "Null", check "Only relevant Value"

    pastedImage_4.png

    To keep today-1 as default, put "Top 1" of Max date of [Date Header]

    pastedImage_5.png

     

    2. Get previous day data

     

    Duplicate Data source

    pastedImage_6.png

     

    On 2nd datasource,

     

    Rename the [Date] field to [Date_Original]

    Create [Date] field as calculated field

     

    [Date]

    [Date-original]-1

    pastedImage_7.png

     

    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.

    pastedImage_10.png

     

    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])   

     

    pastedImage_0.png

     

    Thanks,

    Shin

     

    9.0 attached.

0/9000