Hello Riya
Again, i don't really know if subtotals could be added to a NSQL sentence. If you are interested in my approach (2 portlets) you could do this (and again, that is the way I would do it, don't know if it helps you):
You have to do two different porlets (with queries and pages!!), Portlet 1 will have Information on the project totals, Portlet 2 will have the information on resource totals on an specific project,
You should create the Portlet 2 first, because you will need to know which info do you need to filter.
You should create your NSQL for portlet 2 normally (query all the resource information for the projects), however, you should include a condition for the query to filter on an specific project. Lets say this Query will have the folowing condition on the WHERE clause:
[color=#FD0B0B]srm_projects.id [color]= @WHERE:PARAM:XML:INTEGER:/data/[color=#FD0B0B]id_project[color]/@value@
Remember the id_project part, you will need it later.
After you have created the NSQL 2 and the portlet 2, you should create the page for the Portlet. When you create this page, you should create it with the template option: "Popup page template". Clic on Save and continue. On the creation page, select the "Linkable" option and clic Save and continue.
On the Link Parameters Options you should create a new parameter. The parameter name could be anything you want, the parameter id should be the same code you used on the NSQL, on this case should be [color=#FF0000]id_project[color]. The rest of the process to create the Page is the same.
Now, lets do the Portlet 1 NSQL. You should create this Query normally (in this case you will query the slices for all the projects). You must select in one of the columns the Id of the project. Remember how will you name that coulmn. After the NSQL is validated you must clic on "Linking" Option. Then Click on New:
On the Link creation page, you should put a Name and ID (put the name and id that you want). On the "Action" drop down, look for the NAME of page you created for Portlet 2. When you select that option it will show an aditional Drop Down, in this case, it will be the id of the link of the page you are linking. On the second drop down you must select the column that holds the Project ID.
When you create the Portlet 1, on the Fields Option, you can add the link you created on the NSQL, just click on the "properties" link on the field and add it as a Link. A good field to put it is on the Project Name, however you could put the link on any field you want.
The rest of the process is the same as on any portlet/Portlet page.
Remember one thing, you only need to put the portlet 1 on the Menu, because the portlet 2 will open when you click on the link on portlet 1.
Please let me know if this helps.
Kind Regards
Rafa.