Search these areas:
Support Forums
Product Info

-DataWeb: What's New
-Creating an Application
-The DataWeb Designer
-Application Management
-Data Tables
-Data Tables
-Data Analysis
-Object Model
-Full-Text Search
-Domain and Email Hosting
-HotBlock Modules
-Account Management
-New Responsive UI Module

DataWeb Help
Support Forums
Script Library
Knowledge Base

Home > Support

Support Forum

How do I do "group bys" or aggregates in views?
KevinNicholls asked:
Suppose I have 3 tables:
(Table: Col1Name, Col2Name ...)

Market: MarketID, MarketName
Supplier: SupplierID, SupplierName
Product: ProductID, ProductName, ProductOfferEndsDate, SupplierID, MarketID

Suppose each of my products in my products table is offered in a single market and by a single vendor. 

I want to build a view that has the following colums:
MarketName  #ActiveProducts #TotalProducts
Filter for SupplierID=X

Where #ActiveProducts are those supplier products where the ProductOfferEndsDate >= Today and #TotalProducts is the number of products in the products table that have this SupplierID (independant of ProductOfferEndsDate).
  KevinNicholls responded:
  1 more detail: the result set should only have one line for each distinct market.  
  matthewb responded:
  Grouping queries are not supported in v1.  This is a planned feature for v2.

One workaround is to write a script function to compute the value.  This works OK if the number of rows is reasonable.

Since these numbers probably don't change quickly you could also write a script that computed the values once a day (for instance) and stores them in a separate summary table.
  KevinNicholls responded:
  Thanks for the suggestion.  Anytiming for a v2 rollout that supports this functionality?  
  marki responded:
  V2 will be available this summer, probably in July.  
  dougl responded:
  DataWeb considers this issue closed.
If you have additional questions or comments about this issue, please open it again.
If you have questions about a different topic please open a new support question.

DataWeb Support
  Please Log On
or create your own DataWeb Account.
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us