Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
please find the below table pic. (sorry for posting pic instead of table this is for example )
here i have two weeks '202030' and '202031'. i want to compare two weeks employees whose salary got changed in current week(202031). here i have marked as yellow that only one employee salary got changed in '202031' . I want to bring out that employee from the list.
Please experts help me to get the logic for above one.
Regards,
Pradeep K
Just change the function from concat() to count() add remove the additional arguments in it like:
=Count(DISTINCT {<emp={"=Only({<calweek={'$(=Max(calweek))'}>} sal)<> Only({<calweek={'$(=Max(calweek,2))'}>} sal)"}>} emp)
@kpradeep5610 what is the expected output?
Hi kush,
when i compare two weeks (current week vs previous week) employee salaries. whose employee salary got changed in (current week). i want to count those employees .
example:
here one employee got changed his salary in current week.
You can try something like:
=Concat(DISTINCT {<emp={"=Only({<calweek={'$(=Max(calweek))'}>} sal)<> Only({<calweek={'$(=Max(calweek,2))'}>} sal)"}>} emp, ',')
A simpler expression might be there though.
Hi,
great work.
it is working, but it gives the EMP code not count(emp's).
which is 51774145, instead of emp code i want count like '1'
Just change the function from concat() to count() add remove the additional arguments in it like:
=Count(DISTINCT {<emp={"=Only({<calweek={'$(=Max(calweek))'}>} sal)<> Only({<calweek={'$(=Max(calweek,2))'}>} sal)"}>} emp)
awesome work , it is working as i expected. but when i change it to my real requirement it wont work. please find the below code
=Count(DISTINCT {<EmployeeCode={"=Only({<Calweek={'$(=max(Calweek))'},TableFlag={'W'},[FLAG.Indicator]={'H','N'},MonthIndicator={'C'}>}AnnualSalary)
<>
Only({<Calweek={'$(vPreviousWeek)'},TableFlag={'W'},[FLAG.Indicator]={'H','N'},MonthIndicator={'C'}>}AnnualSalary)"}>}EmployeeCode)
im getting some errors
@kpradeep5610 , In two of your replies you say 'great work', 'awesome work' and your problem is still not resolved. 😋. I know it's your generosity.
Coming back to your issue. The problem could lie in your variable definition or may be somewhere else that would be hard to tell without investigating your app (at least a sample app). Try accordingly.
@tresesco you are done a really great work . but problem is what i have provided that is sample data for this your logic is working perfectly ,when i have changed your logic to my requirement it is not working. i think i missed in set expressions.
I'm working in Qlik enterprise, so I'm not able to provide sample app.
I'm very new to Qlik World
@kpradeep5610 Where you are writing this expression? what are dimensions used ? Can you share some sample to look at?