Ubercart Views 6.x-3.1
Views 6.x-2.12
Views Calc 6.x-1.x-dev

My goal is to show monthly sales broken down by store domain and retail/commercial sales. Commercial sales are handled through user roles. Attached is a screen shot showing the view config, there are two page views that are identical except that one filters by user role = "commercial account" and the other by user role <> "commercial account".

The view that displays the non-commercial sales, adds up a correct total (screenshot #2), the view that displays the commercial sales show the correct orders but the SUM displayed is the total from the non-commercial orders. Can anyone tell me what I'm doing wrong?

CommentFileSizeAuthor
view display60.35 KBjday
view configuration63.66 KBjday

Comments

spacer’s picture

I faced a similar problem with Views Calc when trying to sum Customfield fields in 3 blocks within the same View (each with their own separate set of filters).

I got round the problem by setting up multiple SUM fields in each block - one for each block - and excluding the ones I didn't want to show in each of the displays.

In the Views Calc table style for each page (where you can set whether you want to SUM, COUNT, AVG etc), you can then tick the box for 'display calculation' next to the SUM field you want to display on that page.

Give it a try....

jday’s picture

Thanks spacer for your reply, I only have one column for which I am enabling SUM, and that is the order total. The problem is trying to separate commercial orders from retail orders. I ended up creating another role that will be assigned to all users unless they have a commercial role. Now the two 'sales reports' are adding up correctly, so it seems that views calc could not handle the filter "role <> rolename", as it was still adding up the totals as if the filter was "role = rolename".

Strangely, the view of the orders was correct, just the SUM for what ever reason was making it's calculation on a different set of results...

spacer’s picture

Yes, it sounds much like the same problem. I started out with a single column, but when used across multiple blocks or pages in the same view, the SUM from the first block always appeared as the SUM in all the other blocks/pages (even though the correct results were shown in each block with different filters applied). The only way I could find to break out of this was to create multiple columns in each block, and excluding them, such that only one unique column ever showed in each block - the SUM function then worked ok (even though the blocks were essentially using the same data - but with different filters applied in each case).

Still, good that you found a work-around. Maybe this is something that will be fixed if/when a D7 version appears.....

miro_dietiker’s picture

Status: Active » Closed (duplicate)

Marking this as duplicate of
#510754: Calculations are made against the default display regardless of actual display

Current code is always working with the default display for calcuations.
It seems to me here different displays have added filters.