# Reallocate Weights

Page 1 of 1

## 1 Replies - 1471 Views - Last Post: 18 June 2014 - 08:29 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=348863&amp;s=ab0c516947009f1768c22a14cd77af9b&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 Thinus du Pisanie

Reputation: 2
• Posts: 115
• Joined: 07-October 11

# Reallocate Weights

Posted 18 June 2014 - 04:00 AM

Good day

I am struggling with a problem and can't seem to wrap my head around it.

I have 2 tables.

KPA

Datafields
Perf_KPA_ID (Primary key)
Emp_ID
KPA_ID

KPA_KPI

Datafields
ID (Primary key)
Perf_KPA_ID
KPI
Weight
Result

The entries looks like this.

KPA Table
1__EMP1__KPA1
2__Emp1__KPA2
3__Emp2__KPA1

KPA_KPI
1__1__KPI1__5__1
2__1__KPI2__10__0
3__1__KPI3__5__2
4__2__KPI4__5__3
5__2__KPI5__5__0

Now what I want to do is the following:

If the Result is 0 and the Weight is < 5 then the Weight of that KPI must be divided into the KPI's where the Perf_KPA_ID is the same and the result is not 0 and the Weight of that KPI must become 0

If the Result is 0 and the Weight is > 5 then the Weight of that KPI must be divided into all the KPI's where the Emp_ID is the same in this case EMP1 and the result of any KPI's in that KPA_KPI table is not 0 and the Weight of that KPI must become 0

Any assistance will be greatly appreciated.

Is This A Good Question/Topic? 0

## Replies To: Reallocate Weights

### #2 trevster344

• The Peasant

Reputation: 224
• Posts: 1,519
• Joined: 16-March 11

## Re: Reallocate Weights

Posted 18 June 2014 - 08:29 AM

What have you tried?