Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selecting latest text value in relation to calendar

Hi,

I need to show a employee's current team in a straight table but have run into some issues where the employees have moved team (potentially more than once) and causing rows in the table to be duplicated.

I have tried to move this field from a dimension to an expression, which fixes the duplication, but I cannot get it to show the most current team in terms of associated year and month.

My guess is that this would have to be done with some kind of set analysis, but i've not long started using that so cannot get it right. Can anyone help?

Thanks

5 Replies
anbu1984
Master III
Master III

Can you post sample qvw

vgutkovsky
Master II
Master II

You can try something like this as your expression: firstsortedvalue(Team,-Date)

Regards,

Vlad

MarcoWedel

firstsortedvalue(Team,-MakeDate(year,month))

Not applicable
Author

I've put this into my expression and it has returned a good number of results. For a number of rows though it is returning null, which i've read means that there are multiple matching results. Is there a way that I can select one of the multiple results to show in my table?

vgutkovsky
Master II
Master II

James, that's strange. How can an employee have multiple teams on the same date? If you could share the business logic behind that, maybe we can work out a better way to write the expression.

Vlad