Reference values from views
| Project: | Sheetnode |
| Version: | 6.x-1.x-dev |
| Component: | Documentation |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I have several views setup to calc the total number of nodes with certain qualities. Unfortunately it seems I have to have a new page for each calculation. So I have a separate page for "converted", "failed" and "Pending" and using the views-calc to give me the total number of nodes for each. The view's result is simply a number. To further complicate it I will have more pages to determine for YTD, last 30 days and last 90 days for a total of 9 results.
At first I created a new content type and used 'viewfield' to reference each of the above page results but oops I can't do calculations from them. I suppose I could still use this content type simply to have fields that hold the values as cck fields.
I want to use sheetnode to generate a nice looking report of the above values and calculate percentages etc. Basically use it to use the results from several view queries in a single spreadsheat. Am I making it too hard?

#1
Sheetnode doesn't currently support pulling data from other nodes or views. This could be a feature request.
However, did you try putting your calculations in a single view using a Sheetview style? You can place any field you want in the sheet, along with formulas.
#2
I have a single view with a page for each query. Is it possible to include the results of each page in a single sheet?
The only way I know to get the total rows from a query is using the view_calc so each page is a view calc style. I don't think the result of the query is a field.
I could add another page to the view and make it a sheetnode style but don't think I can reference the other pages results.
#3
I suggest the following:
* For each individual view, convert the view style from Views Calc to Spreadsheet. Set the spreadsheet template (in the Style settings) to place your fields, as well as an additional cell that contains the SUM function (or any other aggregate function).
* Then create a Sheetnode that references the external SUM cells in each view.
Sorry, my suggestion doesn't work because the spreadsheet that is generated by a view is currently not referenceable like ordinary sheetnodes. I'll think of a better way and get back to you.
#4
I did figure out a way to count (using the counta formula) the results within each sheetview but yes I'd like to put all the different results into a single sheet.
I really appreciate all the assistance, thank you.
the viewreference module has a good list of modules that reference views if you are looking at code ideas.
http://drupal.org/project/viewreference
#5
still thinking on this one... and of a new title for the thread
#6
#7
I committed a fix to this feature request. Here's how to test it:
* Clear your caches
* In each of your sheet views, add a new Feed display with Style = SocialCalc format.
* Edit the settings of this style and make sure that "Inherit spreadsheet settings" is ON.
* In your overall results sheet node, refer to the relevant cells in each sheet view using the format "view_internal_name"!CellRef.
What's missing is the ability to send arguments and exposed filter values to the view, I'll be adding that in as well.
Let me know how it works for you!
#8
Automatically closed -- issue fixed for 2 weeks with no activity.