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

Problem with Maximum Function

Started by awais, 03 Oct 2017 06:02:14 AM

Previous topic - Next topic

awais

I am facing an issue with the following statement:

maximum([Timestamp] for [Unique])

My Table doesn't have any unique Attribute, so I created a Unique data item with name Unique by combining 3 data items.

Expression Definition of [Unique] is:

[Entity Name] + [Resource] + [Business Unit]


When I verify my maximum query I get multiple errors:

QE-DEF-0458 CCL Exception
RQP-DEF-0149 The Query specification is incorrect.
RQP-DEF-0217 Wrong Expression Type: maximum([Timestamp] for any [Unique])

MFGF

Quote from: awais on 03 Oct 2017 06:02:14 AM
I am facing an issue with the following statement:

maximum([Timestamp] for [Unique])

My Table doesn't have any unique Attribute, so I created a Unique data item with name Unique by combining 3 data items.

Expression Definition of [Unique] is:

[Entity Name] + [Resource] + [Business Unit]


When I verify my maximum query I get multiple errors:

QE-DEF-0458 CCL Exception
RQP-DEF-0149 The Query specification is incorrect.
RQP-DEF-0217 Wrong Expression Type: maximum([Timestamp] for any [Unique])


How about:

maximum([Timestamp] for [Entity Name], [Resource], [Business Unit])

MF.
Meep!

awais

No Luck still receiving the same error.

MFGF

Quote from: awais on 03 Oct 2017 08:04:44 AM
No Luck still receiving the same error.

Hi,

Ok. A couple of basic questions:
1. Are you using a relational package or a dimensional package
2. Where are you using this expression - filter? query calculation? layout calculation? elsewhere?

MF.
Meep!

awais

Hello,

1. Are you using a relational package or a dimensional package
    The package is relational.

2. Where are you using this expression - filter? query calculation? layout calculation? elsewhere?
     I am using the expression in Filter.

- AR

MFGF

Quote from: awais on 05 Oct 2017 08:17:07 AM
Hello,

1. Are you using a relational package or a dimensional package
    The package is relational.

2. Where are you using this expression - filter? query calculation? layout calculation? elsewhere?
     I am using the expression in Filter.

- AR

Is that the entire expression? A filter expression should equate to a True or a False result

eg maximum([Timestamp] for [Entity Name], [Resource], [Business Unit]) = <some specific value you want to compare it with>

Are you simply missing part of your filter expression, or is there more of it you haven't told us?

MF.
Meep!

awais

I can not compare it with a specific Value. I just want to fetch the latest occurrence for the given Parameters.

Lynn

Quote from: awais on 09 Oct 2017 05:58:03 AM
I can not compare it with a specific Value. I just want to fetch the latest occurrence for the given Parameters.

If you are not comparing it with anything else then it doesn't make any sense as a filter expression. A filter reduces the rows returned from a query by comparing some value in the database with some other value to determine if the record should be included or not in the result set. For example, comparing a transaction date in the database with today's date to see transactions that occurred today.

What is your intended use for this item if not to use for filtering? Perhaps it just needs to be a data item in the query to be displayed?

awais

Thanks for the comment lynn, is there any alternate to return the latest occurrence on the basis of Time-stamp  ?

Lynn

Quote from: awais on 09 Oct 2017 06:21:16 AM
Thanks for the comment lynn, is there any alternate to return the latest occurrence on the basis of Time-stamp  ?

This is basically what MFGF suggested previously, but not sure I am fully understanding what you want to do:

maximum( [Timestamp] for [Entity Name], [Resource], [Business Unit]) = [Timestamp]

That expression would determine the latest timestamp for the scope indicated and compare that with the values in your database to retrieve only the latest occurrence (e.g., the one that matches the result of the maximum calculation).

Your last post suggested you cannot compare the maximum value with anything so not sure what I am not understanding. You also mentioned "given Parameters" although I don't see any mention of parameters in the thread but assumed you just meant entity name, resource, and business unit.


awais