2 Replies Latest reply on Oct 11, 2019 5:49 AM by Jim Dehner

    Use most recent value of property for all previous versions

    Henrik Krogdahl Allentoft

      Hello everyone. My question is reasonably simple, but despite looking at a lot of seemingly similar problems and some intensive googling, I have failed to find a useful solution to my problem.

       

      Deal IDDeal Name
      sync timeIndustry
      Calculated Industry

      3

      London University1/9/2019nullEducation
      3London University2/9/2019nullEducation
      3London University3/9/2019

      Education

      Education
      17London Hospital1/9/2019TravelHealth
      17London Hospital2/9/2019TravelHealth
      17London Hospital3/9/2019HealthHealth

       

      So my data could look something like the above.

       

      I have a daily log of our "deals", which I use for analysis. Thus for all our deals, we have an entry for each day since its creation, with the same Deal ID.

       

      Sometimes we add more info to our deals, either an entire new property is added, which will then obviously have the value null for all previously updated fields, or we correct a mistake in the data or we add data which was simply missing before.

       

      What I want is a calculated property, which fetches the industry value of the most recent deal with same ID, and uses this. How can I create this property?

       

      Thanks a lot in advance for any help.

        • 1. Re: Use most recent value of property for all previous versions
          Mavis Liu

          Hi Henrik,

           

          Not sure in which views you'll be using the calculation, but I've created a LOD using a combination of fixed and exclude:

           

          2019-10-11_13h42_42.png

          2019-10-11_13h44_22.png

           

          The calculation is saying, for every deal ID + Deal name, tell me the maximum sync time. If the sync time matches against the max, show me the industry. The exclude LOD is there because the level of detail in the view has Sync Time and Industry, so would not popular all the fields.

           

          Please see the attached workbook.

           

          If this answers your question, please mark as correct to update this thread.

           

          Thanks,

           

          Mavis

           

           

          We would love to hear your feedback on your Tableau Community Forums experience.

          Please take this 5 minute survey.

           

               Tableau Community Forums | Customer Experience Survey

           

          We appreciate your feedback,

          Tableau Community Forums team

          • 2. Re: Use most recent value of property for all previous versions
            Jim Dehner

            Hi

             

            this will find the last date

             

            and this will find the industry on the last date

             

            it returns this

             

            but the issue is what happens if the last date industry is null

             

            then you could try this

             

            can't test it - don't have your twbx workbook with the data included

            Jim

            If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.