COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: lifzgud on 27 Aug 2010 12:24:25 AM

Title: Find out maximun record based on date,time
Post by: lifzgud on 27 Aug 2010 12:24:25 AM
Hi,
I have a requirement in which i need to show the latest balance that a customer has on his account . For eg I have a customer dimension and a card dimension(DMR Model)
The values are like this

CARD_ID Day            TIME       BALANCE
2000      2010-08-26 1:00 PM      200
2000      2010-08-26 1:15 PM      300
2000      2010-08-26 2:30 PM      275
3000      2010-08-26 3:00 PM      400
3000      2010-08-26 3:15 PM      500

What i need to show is
CARD_ID Day            BALANCE
2000      2010-08-26 2:30 PM      275
3000      2010-08-26 3:15 PM      500

Can anybody tell me the steps on how to achieve this?





Title: Re: Find out maximun record based on date,time
Post by: kenrisen on 27 Aug 2010 03:09:57 AM
hi...

eemmm...maybe you can try this..
1.put your card ID in first column in a list
2.put a query calculation for your second column and put the syntax like below
   tail(time,1)
3.the last step is put the balance in a list

Title: Re: Find out maximun record based on date,time
Post by: lifzgud on 27 Aug 2010 03:40:42 AM
Doesnt work.
I get the following error
Invalid coercion from 'memberSet' to 'value' for 'tail

By the way i need to calculate latest date as well and then the time .
What does the tail function do?
Title: Re: Find out maximun record based on date,time
Post by: MFGF on 27 Aug 2010 04:08:46 AM
Quote from: lifzgud on 27 Aug 2010 03:40:42 AM
Doesnt work.
I get the following error
Invalid coercion from 'memberSet' to 'value' for 'tail

Tail will extract the last member from a set of members. What kind of object is your date/time - a level?

MF.
Title: Re: Find out maximun record based on date,time
Post by: kenrisen on 31 Aug 2010 08:03:03 PM
hi,

did you use DMR?if yes, I think you can used Tail function like MF explain.

If you want use tail use member. What kind of object is your date/time?