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 max Year/Month as 'Y' rest of months as 'N'

Started by kmcgilli, 14 Jan 2020 10:53:31 AM

Previous topic - Next topic

kmcgilli

I am trying to filter on just the maximum month of my dataset and using this:

(Year_Month = maximum ( Year_Month ))
then ('Y')
else ('N')

is not returning 'Y' for the maximum month...

Year_Month looks like this:

201811, 201812, 201901, 201902 etc.

ArnaudStephanHTH

#1
I would create a new data item to store the maximum value of Year_Month (and call it MAX_Year_Month or something), and then filter using that.

And then you could create another data item with the formula

CASE WHEN Year_Month = MAX_Year_Month THEN 'Y' ELSE 'N' END

seb24c

It looks like you just need to make sure it's looking for the maximum of the whole query.

if ( Year_Month = maximum ( Year_Month for report ) ) then ( 'Y' ) else ( 'N' )