If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Aggregation funtion in Query

Started by longbaobao, 31 Oct 2013 02:33:05 PM

Previous topic - Next topic

longbaobao

How can I write an aggregation function for muti columns. For example, I want to get the maximum number of column [A] depends on column [D] and [C].

Is there a valid syntax to fulfill the task, like maximum([A] for ([D] and [C]))?   (This one is illegal)

blom0344

The max function is evaluated against other non-aggregates within the query automatically. If you want to apply a context (evaluate against a limited set of columns) then you use the for predicate.

for 2 columns:  maximum([A] for [col1],[col2])

In your example what is [C]  ?

longbaobao

Quote from: blom0344 on 31 Oct 2013 03:39:54 PM
The max function is evaluated against other non-aggregates within the query automatically. If you want to apply a context (evaluate against a limited set of columns) then you use the for predicate.

for 2 columns:  maximum([A] for [col1],[col2])

In your example what is [C]  ?

Sorry, I was using [ B ] and this one was explained as BOLD... Thanks for your suggestion. I'll have a try