COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: ari_meta on 25 Mar 2010 10:25:43 PM

Title: finding maximum of date
Post by: ari_meta on 25 Mar 2010 10:25:43 PM
I need to find maximum of date for  everyday.  Actually, if a user logs in multiple times in day. then I  need to show last login date with time .

Any input plz .

Ari
Title: Re: finding maximum of date
Post by: IceTea on 26 Mar 2010 07:47:36 AM
What's wrong with the "maximum"-function?
Title: Re: finding maximum of date
Post by: blom0344 on 26 Mar 2010 09:42:09 AM
Just using a max on the date will not automatically give the max date for EVERY user individually. You either should define a ranking on the date against the user and then use a aggregate filter or write a complex filter involving the max..
We've had a similar issue not a long while back, so a quick search on rank / ranking would give you some ideas to work with..
Title: Re: finding maximum of date
Post by: IceTea on 29 Mar 2010 02:52:23 AM
I'm not sure what's the problem with "maximum". We did this alread with the same goal, getting a timestamp of the latest user's action, showing all users. And this was solved with a query calculation & the maximum function.

Title: Re: finding maximum of date
Post by: tiga123 on 29 Mar 2010 04:00:46 AM

the following will get the max of logindatetime per date.
maximum(loginDateTime for date)


the following will get the max of logindatetime per user per date.
maximum(loginDateTime for username,date)