February 3, 2010 at 12:58 pm
Hi,
Below is the data in my table
MarketQtrWeek % Over %Change
HD Q1'09 1 3.91% 3.91%
HD Q1'09 2 5.00% 5.00%
HD Q1'09 3 4.32% 4.32%
HD Q2'09 1 3.26% 7.17%
HD Q2'09 2 3.04% 8.04%
HD Q2'09 3 2.05% 6.36%
HD Q3'09 1 1% 8.17%
HD Q3'09 2 1% 9.04%
HD Q3'09 3 1% 7.36%
The table has data for Market, Qtr, Week, % Over. I need to calculate %change. %change for Q1 09 will be equal to %over. But for Q2 09, %change will be sum of %over of Q1 and Q2 09 grouped by week. For Q3 09, %change is sum of %Over of Q1, Q2 and Q3 09. How to modify the below script to get the %change as desired.
Select Market, Qtr, Week, Over from table;
Thanks
February 3, 2010 at 1:28 pm
Sounds like an issue that fits into the "running total" category.
February 3, 2010 at 8:50 pm
gsanthosh84-663713 (2/3/2010)
Hi,Below is the data in my table
MarketQtrWeek % Over %Change
HD Q1'09 1 3.91% 3.91%
HD Q1'09 2 5.00% 5.00%
HD Q1'09 3 4.32% 4.32%
HD Q2'09 1 3.26% 7.17%
HD Q2'09 2 3.04% 8.04%
HD Q2'09 3 2.05% 6.36%
HD Q3'09 1 1% 8.17%
HD Q3'09 2 1% 9.04%
HD Q3'09 3 1% 7.36%
The table has data for Market, Qtr, Week, % Over. I need to calculate %change. %change for Q1 09 will be equal to %over. But for Q2 09, %change will be sum of %over of Q1 and Q2 09 grouped by week. For Q3 09, %change is sum of %Over of Q1, Q2 and Q3 09. How to modify the below script to get the %change as desired.
Select Market, Qtr, Week, Over from table;
Thanks
Are you actually storing single quotes and percent signs in your tables or is this the output from a query?
--Jeff Moden
Change is inevitable... Change for the better is not.
February 3, 2010 at 9:46 pm
It is for output purpose. I showed it as an example.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply