Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have count of people who are starting and who are terminating year wise. I want the active employee count as per the year if I select year from filter pane. Please find attached image for more information.
We are not looking for your actual data my friend.... we are looking for a representative data which is close to your actual data. I already provided one solution based on what you shared... I am going to provide another... but if that doesn't work... I am afraid I am not going to attempt again unless you provide a sample which is more inline with your actual data
Count(DISTINCT {<Year = {"$(='<=' & Max(Year))"}, Attribute = {'StartYear'}>}[EMP ID]) -
Count(DISTINCT {<Year = {"$(='<=' & Max(Year))"}, Attribute = {'Terminate Year'}>}[EMP ID])
How are you getting 5 for 2002? Total Started is 2 + 3 = 5 and 1 guy left.... Should it be 4? If it is 5, can you explain the logic?
Use Set Analysis,
Try the below expression,
Count({<Year={2002}>}Distinct Employee)
If u want to see all the separate year listed,
Count({<Year={$(=Max(Year))>}Distinct Employee)
Is this the exact representation of the dataset you are working with? I don't think so
Can you provide a sample
yes you correct sorry for that it should be 4
May be like this:
Sum({<Year = {"$(='<=' & Max(Year))"}>}[Employee Who Started]) -
Sum({<Year = {"$(='<=' & Max(Year))"}>}[Employee Who Terminated])
or this:
Sum({<Year = {"$(='<=' & Max(Year))"}>} RangeSum([Employee Who Started] - [Employee Who Terminated]))
This is how dataset looks like.
This is how dataset looks like.
This is how dataset looks like.