1
votes

I am working with Report Studio and need to create a few expressions for a cross-tab query. I am attempting to group orders into age groups (for the rows in the cross-tab). To build these groups I am trying to create an expression like the following:

select [SQL5].[OUTBOUND_ORDER_ID], [SQL5].[PRIORITY] 
where [SQL5].[OUTBOUND_ORDER_LINE_ID] =1 AND [SQL5].[AGE] <= 2

Although this works in most SQL platforms, cognos is not validating the expression. While IBM has a lot of material for calculations, I have been unable to locate any with syntax examples. Can someone who is experience in Report Studio provide a syntax example to perform an expression such as the above? Thanks in advance.

1
Can you clarify - this is against a SQL source, and it's in the layer above? Does your SQL Level return data? Perhaps you need to use a CASE statement - are you familiar with that? - Nick.McDermaid

1 Answers

1
votes

What's the validation error you get? It appears you forgot the FROM part

select [SQL5].[OUTBOUND_ORDER_ID], [SQL5].[PRIORITY] 
from [SQL5]
where [SQL5].[OUTBOUND_ORDER_LINE_ID] =1 AND [SQL5].[AGE] <= 2