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?

Comments

infojunkie’s picture

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.

CobraMP’s picture

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.

infojunkie’s picture


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.

CobraMP’s picture

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

CobraMP’s picture

still thinking on this one... and of a new title for the thread

infojunkie’s picture

Title: got to be an easier way » Reference values from views
Category: support » feature
infojunkie’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Active » Fixed

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!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

costas vassilakis’s picture

Hello.
This is defiantly a great module.

"What's missing is the ability to send arguments and exposed filter values to the view, I'll be adding that in as well."

I would like to ask you if there is any improvement on this.

Thank you in advance.

infojunkie’s picture

@costas: no, not yet. Have you been using the view reference feature? Does it work well for you? If you need to send arguments and/or exposed filters to a view reference, please open a new feature request. I'd be grateful if you could post about your usage of Sheetnode as well :-)

devnyc’s picture

Version: 6.x-1.x-dev » 7.x-1.0-beta3
Component: Documentation » Views

I'm asking to re-open this issue because I have an almost identical use case as the OP, in D7, and have run into the problem of not being able to use the exposed filter on the referenced views fields. In other words, I have a master spreadsheet which references views calc fields from many other pages in the same view, but I am unable to use the exposed filters to filter the referenced data in the main spreadsheet. Has there been any progress on this issue, as I see Karim makes reference to this issue in post #9 above.

CobraMP = Did you ever come to a resolution on this? As I said, my use case is almost identical to yours.

Thanks very much.

infojunkie’s picture

Status: Closed (fixed) » Active

@devnyc, if I understand your post correctly, you want to send exposed filter values to referenced views. Is this what you mean? Right now, only arguments are supported, and they have to be explicitly entered (as opposed to being read from the URL for example).

devnyc’s picture

Ok - was hoping there was at least a workaround I could implement to solve this issue. Thanks for the response.

devnyc’s picture

Hi @infojunkie,

Any progress on the above, i.e. sending exposed filter values to references views? If not, could you provide a little guidance on the alternative you mentioned above, i.e. explicitly entered arguments?

Thanks

infojunkie’s picture

The syntax for referencing an external view from a cell is:

="view-name/arg1/arg2/..."!A1

where argN are the arguments defined in the view as contextual filters. Note that this external view *must* contain a feed display of type "SocialCalc". This is the display that is used to get the referenced cell data.

devnyc’s picture

Thanks, Karim. I've noticed however that on export, these references do not translate. For instance, for the reference "view-name/arg1/arg2"!A1, the arguments work on the spreadsheet view, but on export they are ignored and the cell value is equal to the value of "view-name"!A1, as if there are no arguments. Which over the course of a table, renders the same values for all columns in a row.

Any ideas?

Thanks.

infojunkie’s picture

Exporting references should pull the referenced sheet as a new worksheet in the exported file. If that's not happening, please open a new issue. You can close this one if the references as I described them are functioning properly.

devnyc’s picture

Status: Active » Closed (works as designed)

Closing because the references as infojunkie describes them are working properly.