Forum Discussion

atifbutt's avatar
atifbutt
Frequent Visitor
8 years ago
Solved

If condition with max date

Hi,

 

I'm building dashboard in Direct Query mode.

 

Data = Asatdate, UserID, Name, Ethnicity

 

I'd like to create a oclumn "Ethnicity Type" and to put values from Ethnicity column if the UserID field is not duplicate, if it is duplicate then put the latest value for Ethnicity by date.

 

Thank you in advance for the help.

 

Thanks

Atif

  • atifbutt's avatar
    atifbutt
    8 years ago

    Thanks for replying Xiaoxin. I've found the solution via sql query :).

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi atifbutt,

     

    Please share some sample data for test and coding formula.

     

    Regards,

    Xiaoxin Sheng

    • atifbutt's avatar
      atifbutt
      Frequent Visitor

      Thanks for replying Xiaoxin. I've found the solution via sql query :).

      • Stuznet's avatar
        Stuznet
        Helper V

        Could you kindly post the SQL solution?

         

        Thanks