Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pavan045
Contributor III
Contributor III

Employee current status in text box

I have a table like this

EmpIdStartDateEndDateStatus
130/09/201420/01/2015Under Training
121/01/20152/3/2015Buisiness Wait
13/3/201431/01/2016In Project
210/3/201521/06/2015Under Training
222/06/201520/09/2015Buisiness Wait
327/12/201426/02/2015Under Training
327/02/201516/06/2015Buisiness Wait
317/07/201531/01/2016In Project

From this how can I show Employee status on 31/01/2016 in a text box with out using date filter.

1 Solution

Accepted Solutions
pavan045
Contributor III
Contributor III
Author

Thank you for your answer sunny...

Your expression gives null values only. I just added 'DISTINCT' and it works.

Final Expression is FirstSortedValue(distinct Status, -EndDate).

Thank you.

View solution in original post

5 Replies
sunny_talwar

Try this:

=FirstSortedValue(Status, -EndDate)

Capture.PNG

swuehl
MVP
MVP

Maybe the status of EmpId is undefined after 20/09/2015, do you want to show her status then?

You can filter using set analysis:

=FirstSortedValue({<StartDate = {"<='31/01/2016'"}, EndDate = {">='31/01/2016'"}>} Status, -EndDate)

pavan045
Contributor III
Contributor III
Author

Thank you for your answer sunny...

Your expression gives null values only. I just added 'DISTINCT' and it works.

Final Expression is FirstSortedValue(distinct Status, -EndDate).

Thank you.

pavan045
Contributor III
Contributor III
Author

Thank you for your answer Swuehl

Please don't bother about EmpId Status after 20/09/2015.

Below expression worked for me.

FirstSortedValue(distinct Status, -EndDate)

Thank you.

sunny_talwar

Awesome, I am glad you were able to figure it out.

Please close the thread if you have got the answer you were looking for by marking correct and helpful answers.

Best,

Sunny