1 Reply Latest reply on Apr 24, 2018 4:22 AM by kumar bharat

    Parsing to R for Complex Calculations

    Sounak Bhattacharya

      Hi,

       

      I am working on historical data. The data is stored as a snapshot of the entire data set at the end of the day. Due to confidentiality I can't share the data..but its structured as follows

       

      record id || Snapshot Date || Create Date || Closed Date(expected) || Category || Amount (expected)   

           1             17/03/2018         7/02/2018                21/12/2019                    A               100

                          18/03/2018         7/02/2018                21/12/2019                    A               120

                               .

                               .

                               .

                          24/04/2018         7/02/2018                23/11/2018                     B                120

                              (Today)                                             (changed)               (changed)   (can change)

         

           2.           similarly---------------------

       

      I am working on a dashboard where user selects two sets of start and end dates as input from 4 parameters. 1 set to compare on Snapshot Date and the other set to Compare Create and Closed date. The category, amount and closed date can change over time as shown above.

       

      Using these there are many IF-THEN-ELSE calculation that needs to be done to bucket each record id as types 1,2,3,4,5 etc...(say).

      For example, if 1st set of input dates are 30th March and 15th April (say) and if record 1 (shown above) has changed amount between dates 30th March and 15th April, then record 1 is Type 1 if increase, Type 2 if Decreased...so on

      Each record Id can be part of two or more of these buckets [1,2,3,4,5 etc] depending on the input dates.

      There are Fixed Calculations at the lowest level of granularity (as per requirement) and there are numerous filters each sheet of the dashboard.

       

      All this has slowed down the performance severely......

       

      Is there a way to parse these input dates from the parameters to a R environment to do these IF-Then-Else calculations and send it back to Tableau?

      Remember, users of this dashboard will keep changing dates while using it to see the view they want to.

       

      Also, please suggest any other method to improve performance....

       

      Regards,

      Sounak