This thread is similar to the thread (Select only 10 columns going back) that I posted regarding the dynamic selection of data going back one month at a time for 12 months. Here is the qiote fron the other thread (#3) :
This time, the difference is in how the data from the table is presented. I constructed the table from a series of data dumps that are issued monthly. I select the column with the data that I want, called PV and rename the column for the month in which it came. For example, if I took a column corresponding to the month of January, the metadata would look like this:
The Sample data looks like this:
and so on
I rename the fields Name to UserName and Approve to PV.
I then do a SQL join with tblMembers table, which has this structure:
Here is some sample data:
and so on
I then write sql for a right join between tblMembers and the built tables.
I add every table representing a month and I end up with a table which i called Dashboard_PV. Its structure is:
here is some sample data:
and so on
I hope this is clear. I am not sure if I went about it the right way - your help is appreciated,
Richard
Originally posted by Rickster
Code:
Table Name=[[U]1/31/2007[/U]] [I]Field; Type; IndexInfo[/I] ID; String; Name; String; PK Approve; Numeric
Code:
ID Name Approve 1 LE_DH 4518 2 DONG_PA 3182 3 DANG_HT 3175
I rename the fields Name to UserName and Approve to PV.
I then do a SQL join with tblMembers table, which has this structure:
Code:
Table Name=[[U]tblMembers[/U]] [I]Field; Type; IndexInfo[/I] MemberID; String; PK Name; String UserName; String Initials; String
Code:
MemberID Name UserName Initials 1 Dang,Hong dang_ht htd 2 Dong,Patrick dong_pa pdd
I then write sql for a right join between tblMembers and the built tables.
I add every table representing a month and I end up with a table which i called Dashboard_PV. Its structure is:
Code:
Table Name=[[U]Dashboard_PV[/U]] [I]Field; Type; IndexInfo[/I] Initials; String; PK UserName; String February2008; Numeric January2008; Numeric December2007; Numeric
Code:
Dashboard_PV Initials UserName February2008 January2008 December2007 HTD dang_ht 3165 4523 4043 KKD diep_kk 2528 2662 1409
I hope this is clear. I am not sure if I went about it the right way - your help is appreciated,
Richard
Comment