3 Replies Latest reply on Feb 28, 2019 12:03 PM by Sidharth kumar Jasra

    How to copy value from the previous month if the record is not present in a given month.

    Sidharth kumar Jasra

      Hi Guys,

       

      Can anybody please help me in the given problem.

       

      SCENARIO: Four Players James, Rahul, Kate and Paul plays PUBG game every month. They are given status after their overall monthly performance [Good, Excellent, Outstanding]. However, not all players play every month. In that case, their last played month status is considered for that month. E.g. James did not play in February. Therefore his January status which was GOOD would be considered for the February month.  If James does not play again until September, his status from January should still be considered the value per month.

       

      1. OUTCOME DESIRED: The game conducting organizer wants to see the overall performance trend of the players every month from January until September. They want to build stack bar graph: X-axis Months, Y-axis: Count of players performance by color i.e. good, excellent or outstanding. It essentially means that count for every month will be same i.e. total number of players which is four in the given case.

       

      ISSUE: Given that not all players have played in a given month, there is no entry in the database for that USER_ID and PERFORMANCE_STATUS so it must inherit the value from the previous month and display it as a count in order to properly display the Y-axis.

       

      In my attempts thus far, I have used lookup() function to generate the performance of the player [took from the last played month] if the player has not played game in the current month. However, lookup() function performs TABLE CALCULATION which means we cannot make any visualization rather only can display result in the table form.

       

      How can we generate the stacked bar graph? So, that Tableau considers and assigns the performance status to the player from the last played month if he/she has not played in the current month.  Or is there another approach as to how to get the data in a usable format for this visualization?

       

      I have attached sample data as well for the reference.

       

      Thank you.