Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'll appreciate your help on a issue I have regarding adding a record to an existing table.
The table is looking like this:
Agent YearMonth Group ref_number
1 2013-01 A 6
2 2013-01 A 6
4 2013-01 A 6
5 2013-01 A 6
1 2013-01 B 9
2 2013-01 B 9
3 2013-01 B 9
4 2013-01 B 9
5 2013-01 B 9
1 2013-02 A 7
2 2013-02 A 7
3 2013-02 A 7
4 2013-02 A 7
5 2013-02 A 7
1 2013-02 B 2
2 2013-02 B 2
4 2013-02 B 2
5 2013-02 B 2
What I would like to do is to add a new record to all YearMonths which do not have agent data for each group.
I mean that to YearMonth 2013-01 you can see that for group A there is no data for 'Agent' number 3 and for 'YearMonth' 2013-02 you can see that we do not have data for 'Agent' 3 in group B.
At any case the Agent that will be missing will be always Agent number 3.
The new records that need to be added to the table should be as shown below:
3 2013-01 A 6
3 2013-02 B 2
I'll appreciate you prompt help on this.
Thanks in advanced
David
ORIGINAL_TABLENAME would be the above table name. concatenate(ORIGINAL_TABLENAME) LOAD * INLINE [ group name, company Group 1, Company A Group 1, Company B Group 2, Company C Group 3, Company D Group 3, Company ELOAD * INLINE [ Agent, YearMonth, Group, ref_number 3, 2013-01, A, 6 3, 2013-02, B, 2 ];
ORIGINAL_TABLENAME would be the above table name. concatenate(ORIGINAL_TABLENAME) LOAD * INLINE [ group name, company Group 1, Company A Group 1, Company B Group 2, Company C Group 3, Company D Group 3, Company ELOAD * INLINE [ Agent, YearMonth, Group, ref_number 3, 2013-01, A, 6 3, 2013-02, B, 2 ]; add this script below the table script and try reloading
I would like to add the records in an automatic way if it is recognized that those records are missing than the script should add them automaticlly.