If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Return rows corresponding to latest date for a composite key

Started by japwah, 14 Dec 2016 01:55:28 PM

Previous topic - Next topic

japwah

This is a question that's probably simple for most of you. I have not used Framework Manager for years, and have only been exposed to it briefly.

I have a table that looks like this:

Row         AgentID       PolicyID       PolicyType        Last Name      UpdatedDate

1              11111          12345          Regular           Smith              Jan 1, 2016
2              11111          12345          Special            Smith              Jan 5, 2016
3              22222          23456          Special            Brown              Jan 2, 2016
4              22222          23456          Special            Taylor              Jan 3, 2016

In FM, I want to somehow apply a filter to the table so the result returns only the data corresponding to the latest Updated date for an AgentID/ PolicyID combination, e.g. only rows 2 and 4.

Thanks for your help.

MFGF

Quote from: Yason3 on 14 Dec 2016 01:55:28 PM
This is a question that's probably simple for most of you. I have not used Framework Manager for years, and have only been exposed to it briefly.

I have a table that looks like this:

Row         AgentID       PolicyID       PolicyType        Last Name      UpdatedDate

1              11111          12345          Regular           Smith              Jan 1, 2016
2              11111          12345          Special            Smith              Jan 5, 2016
3              22222          23456          Special            Brown              Jan 2, 2016
4              22222          23456          Special            Taylor              Jan 3, 2016

In FM, I want to somehow apply a filter to the table so the result returns only the data corresponding to the latest Updated date for an AgentID/ PolicyID combination, e.g. only rows 2 and 4.

Thanks for your help.

Hi,

Add a filter to the query subject with the expression

[UpdatedDate] = maximum( [UpdatedDate] for [AgentID], [PolicyID] )

Cheers!

MF.
Meep!