Forum Discussion
atifbutt
8 years agoFrequent Visitor
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 UserI...
- 8 years ago
Thanks for replying Xiaoxin. I've found the solution via sql query :).
Anonymous
8 years agoNot applicable
atifbutt
8 years agoFrequent Visitor
Thanks for replying Xiaoxin. I've found the solution via sql query :).
- Stuznet8 years agoHelper V
Could you kindly post the SQL solution?
Thanks
- atifbutt8 years agoFrequent Visitor
Select field1,field2,field3
from (select field1,field2, field3,
row_number() over (partition by employeenumber order by (datefield "to pick the latest record") desc) as rn from tablename) as T
Where RN = 1 - atifbutt8 years agoFrequent Visitor
Select field1,field2,field3
from (select field1,field2, field3,
row_number() over (partition by employeenumber order by (datefield "to pick the latest record") desc) as rn from tablename) as T
Where RN = 1- Stuznet8 years agoHelper VThank you so much