Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
francis_gr
Creator
Creator

salary comparison by position

Hi group!

I need your help  that by selecting an n_empl from the n_empl list box and a position from the Select_Position input box that is stored in the variable v_p, for the selected year, the following data appears in a graphFrom the selected employee, appear the n_empl, Position, Payment, Selected Position, the average payment of the selected position and the difference between both.

Thank's in advance.

Labels (1)
1 Solution

Accepted Solutions
Marijn
Creator II
Creator II

@francis_gr I was curious whether it was possible, so I worked out the solution with Alternate States.  

First create two alternate states. Go to Settings->Document Properties->General->Alternate Sates
Add Group1 and Group2.

Create list boxes for the different selections. In this case I made two listboxes per group, year + position and year + n_empl.

Add the groups to your expressions (see the example qvw in attachments).

Make the desired selections to see results.

Regards,

Marijn

View solution in original post

6 Replies
Marijn
Creator II
Creator II

Hi @francis_gr ,

You can use =avg(total <Position> Payment) for the average payment per position. Then use the two calculated columns to calculate the difference between payment and average payment.

See the query qvw I attached.

Hope it helps!

francis_gr
Creator
Creator
Author

Hi Marjin

First of all thanks for your answer. It's perfect except that since I needed it to show the average of the selected position in the Select_Position input box, I changed the expression for calculating the average by including the variable v_p in the expression.

The problem I have now is that when selecting an employee, the value of the fields Average Payment and Difference to Average disappear

I would need this data to be displayed when selecting an employee.

I send you the modified file

Regards

Marijn
Creator II
Creator II

As far as I see, you can't select an employee and a position that is not linked to that particular employee at the same time. Because selecting for example employee 518 (with the position 'do'), will exclude the date of the other positions.

The only viable option I see, is just comparing an employee to averages of all type of positions. See attachment.

Regards

francis_gr
Creator
Creator
Author

Hi Marjin

Thank you for your response and for your time.

The option you propose is good but I really need to select an employee and compare their compensation with the average compensation of the position selected in the input box.

Regards

Marijn
Creator II
Creator II

@francis_gr I was curious whether it was possible, so I worked out the solution with Alternate States.  

First create two alternate states. Go to Settings->Document Properties->General->Alternate Sates
Add Group1 and Group2.

Create list boxes for the different selections. In this case I made two listboxes per group, year + position and year + n_empl.

Add the groups to your expressions (see the example qvw in attachments).

Make the desired selections to see results.

Regards,

Marijn

francis_gr
Creator
Creator
Author

Hi Marjin!

It's a pretty clever solution. It really solves the problem, but I think there must be a more direct solution without the need to create two different select boxes which can confuse the end user a bit.

I really appreciate your interest in helping me and the time you dedicate to me.

Regards