我有四个支点,我从这个样子中提取数据:
tracked_work_by_users_by_operation_pivot:
+-------------------+---------------+---------------+-----------------------+---------------+
| DATE(start_time) | userid | operation_id | Time estimated | Time Elapsed |
+-------------------+---------------+---------------+-----------------------+---------------+
| 1/2/2011-1/8/2011 | jsmith | 11| 40| 40|
| 1/2/2011-1/8/2011 | jsmith | 10| 20| 24|
+-------------------+---------------+---------------+-----------------------+---------------+
faults_by_user_pivot:
+-------------------+---------------+---------------+-----------------------+----------+
| date(date_entered)| userid | operation_id | Major | Minor |
+-------------------+---------------+---------------+-----------------------+----------+
| 1/2/2011-1/8/2011 | jsmith | 11| 2 | 1|
+-------------------+---------------+---------------+-----------------------+----------+
paid_hours_by_user_pivot:
+-------------------+---------------+---------+
|date_range | userid | Total |
+-------------------+---------------+---------+
| 1/2/2011-1/8/2011 | jsmith | 40 |
+-------------------+---------------+---------+
tracked_work_by_users_pivot:
+-------------------+---------------+---------+
|DATE(start_time) | userid | Total |
+-------------------+---------------+---------+
| 1/2/2011-1/8/2011 | jsmith | 24 |
| | | |
+-------------------+---------------+---------+
我需要做的是为每个操作编译每个用户的报告。从我看到的最好的方法是使用类似于:
的格式 +--------------+--------------+ +--------------+--------------+
| jsmith | packaging | | jsmith | machining |
+--------------------+--------------+--------------+----------------+--------------+--------------+--------------+--------------+----------------+--------------+--------------+
| DATE | time_elapsed | hours_worked | estimated_work | minor_faults | major_faults | time_elapsed | hours_worked | estimated_work | minor_faults | major_faults |
+--------------------+--------------+--------------+----------------+--------------+--------------+--------------+--------------+----------------+--------------+--------------+
| 1/2/2011-1/8/2011 | 24 | 40 | 36 | 1 | 2 | 24 | 40 | 36 | 1 | 2 |
+--------------------+--------------+--------------+----------------+--------------+--------------+--------------+--------------+----------------+--------------+--------------+
因此,jsmith将有单独的加工和包装条目,因为我们希望能够将他与所有加工操作员和所有包装操作员进行对比。我怎样才能最好地做到这一点,这样每次添加新用户时我都不需要再添加12个条目(因为有12个操作)?
答案 0 :(得分:0)
这样做的最佳方法似乎是简单地编写一个应用程序,而不是强力武装excel。