# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Contributor III

## Match expression using max(Date)

Hi,

I'd like to retrieve the latest text field for each specific type of values.

ie:

 Rule Date Comment R_AMO 2015-07-11 Fruit R_AMO 2015-07-14 Vegetable R_AMO 2015-07-15 Fruit R_SSG 2015-07-11 Vegetable R_SSG 2015-07-12 Fruit R_SSG 2015-07-12 Vegetable R_SSG 2015-07-13 Fruit R_SSG 2015-07-13 Vegetable R_SSG 2015-07-14 Fruit R_SSG 2015-07-15 Fruit R_SSG 2015-07-15 Vegetable R_SSG 2015-07-16 Vegetable

Well the latest comment for R_AMO is Fruit, but the latest comment for R_SSG is Vegetable. Not that the latest date for R_AMO is 2015-07-15 but is 2017-07-16 for R_SSG.

I've got this down as an expression for my dimension "Comment" in a chart.

= if(match(Date, '\$(=Max(Date))'), Comment, 'nay')

All I get are Nays

Any ideas on this?

1 Solution

Accepted Solutions
MVP

## Re: Match expression using max(Date)

Try this:

=If(Date = Aggr(NODISTINCT Date(Max(Total <Rule> Date)), Rule), Comment, 'nay')

6 Replies
MVP

## Re: Match expression using max(Date)

Try this as your calculated dimension:

= if(match(Date, '\$(=Date(Max(Date)))'), Comment, 'nay')

Contributor III

## Re: Match expression using max(Date)

Right,

R_AMO is still at nay because the Max date for the entire set is 2015-07-16... but R_AMO's maxdate is 2015-07-15...

MVP

## Re: Match expression using max(Date)

Got it, working on it now

MVP

## Re: Match expression using max(Date)

Try this:

=If(Date = Aggr(NODISTINCT Date(Max(Total <Rule> Date)), Rule), Comment, 'nay')

Contributor III

## Re: Match expression using max(Date)

that's a winner right there.

MVP

## Re: Match expression using max(Date)

Awesome

Glad I was able to help.

Best,

Sunny