Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | SQLnessStarting Member
 
 
                                        2 Posts | 
                                            
                                            |  Posted - 2013-11-05 : 13:22:12 
 |  
                                            | Trying to duplicate functionality of an excel sheet which calculates percentages within same column using prior group values.  Not sure how to construct such a data set.The column is part of a pivot with an integer value representing a sum.For example:  GroupVal1    Val1    Val2    Val3GroupVal2    Val1    Val2    Val3Need to create a data set to calculate GroupVal2/GroupVal1, (Groupval2) Val1/ GroupVal1 Val1, etc. for all the detail rows.Any suggestions what SQL to use for this? |  |  
                                    | visakh16Very Important crosS Applying yaK Herder
 
 
                                    52326 Posts | 
                                        
                                          |  Posted - 2013-11-05 : 14:34:10 
 |  
                                          | Did you try using ReportItems collection?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |  
                                          |  |  |  
                                    | SQLnessStarting Member
 
 
                                    2 Posts | 
                                        
                                          |  Posted - 2013-11-06 : 12:54:38 
 |  
                                          | Yes, but they are not in the same group, so not in scope. |  
                                          |  |  |  
                                    | visakh16Very Important crosS Applying yaK Herder
 
 
                                    52326 Posts | 
                                        
                                          |  Posted - 2013-11-06 : 13:10:50 
 |  
                                          | did you try using rownumber function?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |  
                                          |  |  |  
                                |  |  |  |