Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a table of trainings , in which there is eventid, trainingcost and empids of the attendees for the training, in table of employees each employee has departmentid,
i want to distribute the event cost to the departments, like if event A cost occured was 30$, and there were 3 attendees , so the cost will be divided 10$ to each department.
my tables are
eventid | cost | empids |
---|---|---|
1 | 30 | emp1 |
1 | 30 | emp2 |
1 | 30 | emp3 |
empid | dept |
---|---|
emp1 | dept1 |
emp2 | dept2 |
emp3 | dept3 |
i need to show in some chart, i will take dept as dimension but what would be the expression??
see attached
See attached files. Note that empids header intrainings table was changed to empid so that an association occures.
Thanks Giakoumakis for the reply, but u have intrepreted cost on each individual separately , where as in my system cost is charged on eventid, not on each individual.
Further my event and attendees are related as hierarchy( i have related them by hierarchy model),
So the picture is like, we have events and events have cost, an event has attendeees and attendees belong to departments.
I need to equally divide the cost of event on all attendees, and sum the cost occured on departments
Would it be OK to do in the load statement? Or must it be done in chart?
it would be fine bt how would u distribute the cost (in other table) divide on attendees( in other table )
see attached