M
Mariam
Dear all,
I built a file that imports data from an external source (excel
format). The code that I wrote does not only import the data but also
adds additional calculated columns.
One of the sheets contains data about orders to different countries,
it looks something like this :
Country Order_M Ord_Nr Qty Prod. TAT_act. SLA_TAT SLA_Achieved
Austria jan. 04 prf001 25 pencil 12 13 yes
Austria may. 04 prf002 36 paper 10 13 yes
Belgium feb. 04 prf003 78 pencil 15 11 no
France feb. 04 prf004 10 paper 25 11 no
France mrt. 04 prf005 15 paper 35 11 no
UK jan. 04 prf006 15 pencil 8 10 yes
UK apr. 04 prf007 25 paper 9 10 yes
Sweden apr. 04 prf008 30 paper 10 9 no
In the next sheet (sheet 2) I want to make a number of tables using
the above data. This table is formatted and looks as follows:
|#orders |In TAT| | |OutTAT|
Country| Month |Product |placed |Total | % |SLA |total | % |SLA|
---------------------------------------------------------------------
Austria| jan. 04 |pencil | 1 | 1 |100%| 95% | 0 | 0 | 3%|
| may. 04 |paper | 1 | 1 |100%| 95% | 0 | 0 | 3%|
Austria total | 2 | 2 |100%| 95% | 0 | 0 | 3%|
Column 1: Country name (column 1 in data sheet)
Column 2: Month (Oder_Month in data sheet)
Column 3: Product (Product in data sheet)
Column 4: #Orders placed (Count Order_Nr in sheet 1 where
country_sheet1 is
equal to country_sheet2)
Column 5: within TAT (Count "yes" in column SLA_Achieved in sheet 1
where
country_sheet1 is equal to country_sheet2)
Column 6: % (within TAT divided by #orders placed)
Column 7: SLA pre-defined percentage (means that a minimum of 95% of
all
orders must be within TAT)
Column 8: Outside TAT (Count "no" in column SLA_Achieved where
country_sheet1 is equal to country_sheet2)
Column 9: % (outside TAT divided by #orders placed)
Column 10: SLA pre-defined percentage (means that a maximum of 3% of
all
orders can be outside TAT)
I want to generate this formatted table automatically. I never know
before hand how many orders have been placed for what products and
what time frame. The tables need to be dynamic.
One way of doing this is via the pivot table. But can I add columns
that are not in the data sheet ? (column 7 & 9). Or do I need to add
these to the data sheet ? Can i have formats added automatically in
the pivot ?
Can any of you tell me how I can do this dynamically ? What is the
code that I need to write ? If there is something that is not clear do
not hesitate to let me know.
Your tips & recommendations are highly appreciated. Thanks in advance
!
Gr,
Mariam
I built a file that imports data from an external source (excel
format). The code that I wrote does not only import the data but also
adds additional calculated columns.
One of the sheets contains data about orders to different countries,
it looks something like this :
Country Order_M Ord_Nr Qty Prod. TAT_act. SLA_TAT SLA_Achieved
Austria jan. 04 prf001 25 pencil 12 13 yes
Austria may. 04 prf002 36 paper 10 13 yes
Belgium feb. 04 prf003 78 pencil 15 11 no
France feb. 04 prf004 10 paper 25 11 no
France mrt. 04 prf005 15 paper 35 11 no
UK jan. 04 prf006 15 pencil 8 10 yes
UK apr. 04 prf007 25 paper 9 10 yes
Sweden apr. 04 prf008 30 paper 10 9 no
In the next sheet (sheet 2) I want to make a number of tables using
the above data. This table is formatted and looks as follows:
|#orders |In TAT| | |OutTAT|
Country| Month |Product |placed |Total | % |SLA |total | % |SLA|
---------------------------------------------------------------------
Austria| jan. 04 |pencil | 1 | 1 |100%| 95% | 0 | 0 | 3%|
| may. 04 |paper | 1 | 1 |100%| 95% | 0 | 0 | 3%|
Austria total | 2 | 2 |100%| 95% | 0 | 0 | 3%|
Column 1: Country name (column 1 in data sheet)
Column 2: Month (Oder_Month in data sheet)
Column 3: Product (Product in data sheet)
Column 4: #Orders placed (Count Order_Nr in sheet 1 where
country_sheet1 is
equal to country_sheet2)
Column 5: within TAT (Count "yes" in column SLA_Achieved in sheet 1
where
country_sheet1 is equal to country_sheet2)
Column 6: % (within TAT divided by #orders placed)
Column 7: SLA pre-defined percentage (means that a minimum of 95% of
all
orders must be within TAT)
Column 8: Outside TAT (Count "no" in column SLA_Achieved where
country_sheet1 is equal to country_sheet2)
Column 9: % (outside TAT divided by #orders placed)
Column 10: SLA pre-defined percentage (means that a maximum of 3% of
all
orders can be outside TAT)
I want to generate this formatted table automatically. I never know
before hand how many orders have been placed for what products and
what time frame. The tables need to be dynamic.
One way of doing this is via the pivot table. But can I add columns
that are not in the data sheet ? (column 7 & 9). Or do I need to add
these to the data sheet ? Can i have formats added automatically in
the pivot ?
Can any of you tell me how I can do this dynamically ? What is the
code that I need to write ? If there is something that is not clear do
not hesitate to let me know.
Your tips & recommendations are highly appreciated. Thanks in advance
!
Gr,
Mariam