Answered Calculate list values based on multiple fields/rows

  • Friday, April 13, 2012 3:29 PM
     
     

    I need to calculate some values liek you could do easily in excel....

    So i have a list like so

    value1 value2 project
    12   Proj1
    234 4  
    23 234 Proj2
    678    
      23 Proj1
      234 Proj3
    678 4 Proj3

    I need to calculate the total values for proj1, proj2, etc. subrtacted from a predetermined constant value not on the list. 

    I know that this is not possible using calculated fields (you could rig something similar that'd be ugly if you made a column for every project, but there could be dozens, frequently changing).  And I'd prefer to be able to use audience targeting to control who sees the result

    Also, I do not have visual studio, but maybe I can obtain it. 

All Replies

  • Friday, April 13, 2012 4:16 PM
     
     

    Kindly just think little bit on my solution. 

    C you need to calculate the values1 and value2 of each project.  For this you should first get the distinct or unique value of each project whatever the name. foreach project you get through Linq distinct loop whole array n calculate it one by one.

    http://stackoverflow.com/questions/4761903/using-a-loop-get-unique-values-form-a-list-then-add-another-value

     

    You should go with Linq and then Custom Visual webpart to complete this task. Create one Visual webpart and do it via Vs2010.

    May b this may help you.


    http://www.abdulazizfarooqi.wordpress.com BizTalk Developer UBL Transformation

  • Friday, April 13, 2012 5:41 PM
     
     

    It can be done easily if you can utilize two views,  Create two views one Filtered with project = Proj1 and other with Proj2.

    Edit those views to get Total Count in the summary for the required columns.

    If possible, you can subtract your permanent value by adding it as an item with -ve Value.

    Hope this helps.


    Rahul Gupta, MCPD - SharePoint 2010

  • Friday, April 13, 2012 8:18 PM
     
     

    I might have mentioned that I don't "own" my site, I have "site owner" permissions, but this is short of admin, and there are numerous things that I cannot do, not sure if this is one of them because I don't have Visual studio to try it.  (need approval to get it because it costs $$)

    the programming logic is rather simple, more concerned about how I can read from sharepoint lists, and display the results. i.e. the tools and methods for doing this.

    thanks though.

  • Friday, April 13, 2012 8:20 PM
     
     
    I understand it can be done this way, but it's far from Ideal, what if there are 50 projects and you want to see a summary of all of them...
  • Sunday, April 15, 2012 5:37 PM
     
     Answered

    Then do this, create a new view and modify the Group By and Totals Column like this:

    Output should be like this:


    Rahul Gupta, MCITP, MCPD - SharePoint 2010