Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO PERFORM A DISTINCT COUNT ?

Status
Not open for further replies.

NicolaTesla1

Programmer
Feb 9, 2009
37
0
0
CA
Hi,

I have a data item in my query that has the following expression:
count(distinct [Material Real Key] for [Store Real Key])

I validate the report and NO error message.

I have a simple LIST with only 2 columns: [Store Real Key] and [Product Key]
I then create a footer by choosing "Store Real Key (footer)" for my list and validate still no error message.

I unlock my report, i then try to ADD the data item to the Footer but keep on getting this error:
OP-ERR-0088 A syntax error was detected near 'count'.


Anyone any ideas ?

Thanks in advance !
 
I may be missing the point, but you have probably multiple values for store real key in the list. So ,the count will yield multiple values. How do you propose to add those to the footer?

Ties Blom

 
Hi blom0344,

1- No that is a key that is unique.
2- I was creating the calculation i needed in a data item
Then i selected my list object and then create a footer.

Does this answers your question "How do you propose to add those to the footer?"

3- Finally i found another way to calculate the rows on my list. I wasn't able to use the count function on the string type column. So i create a data item containing the expression: 1

I then had to count on that column and it works.

Thanks !
 
Your problem with the first attempt may be due to the fact that if you in any way refer to a dataitem that is not in the list layout, Cognos expects you to associate it with the list through the list properties setting.

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top