1 Reply Latest reply on Sep 11, 2019 9:24 AM by shuhei saito

    Tableau 2019.2: How to fill empty data with previous data and how to select data based on position

    Angelica  Grillo

      I have data that are Bank Account Balances. My data source is a table with date, transaction description, amount of transaction, and balance after that transaction. If there were no transaction during a a certain days, there will be no data for that day.

      Also, there might be multiple transactions in a day, therefore, multiple balances assigned to that date.

      I have this structure for multiple banks and I have a field with Bank Account Names.

       

       

      I want to create a summary table with Bank Account (which I have), date, and balance of that account at the end of that date.

      I have two problems that seem to be related:

      1. The days that there are no transactions are empty and need to be filled with previous day balance, until a day has a new balance. When the day has a new balance, I need it to be new next balance.
      2. The days that I have multiple transactions, I don’t know how to choose the balance in the last row assigned to that Bank Account of that day. I know how to do it in excel, using the position of the values, but I do not know how to do it in Tableau. The balances I circles are the ones I want selected as balances for the day.

      Here are the solutions I tried but did not get very far:

      I tried using Previous_Value function but when there was a day with a new balance I kept getting the balance of the first day.

      Let me know if there is more info you need.

       

      If anybody can help me, I would appreciate it.