COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: EArumugam on 29 Oct 2009 02:26:35 AM

Title: Promt Macro
Post by: EArumugam on 29 Oct 2009 02:26:35 AM
Hi,

I am using prompt macro function in my report.

i am taking multiple year values in the prompt macro function

Year in #prompt ('year').

from that i need to take the maximum value.
i tried with max function. but not sucessful.

is anyother way to get the maximum value
Title: Re: Promt Macro
Post by: sivakumar.sm on 29 Oct 2009 03:54:38 AM
create a data item with the expression maximum([Year] for report).

I think you should use #promptmany to get multiple select prompt.
Title: Re: Promt Macro
Post by: EArumugam on 29 Oct 2009 04:05:58 AM
thanks for you reply siva.

I used this prompt macro function in native sql for calculation.
from that i need to take maximum value.

for ex.

select * from table where year = (max#prompt('year')#)

from the above query i need to take the all the values  from the table where year max year.
Title: Re: Promt Macro
Post by: sivakumar.sm on 29 Oct 2009 05:28:35 AM
max will not work in Where clause, try writing a subquery for the prompt