Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sibrulotte
Creator III
Creator III

Match expression using max(Date)

Hi,

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

ie:

      

RuleDateComment
R_AMO2015-07-11Fruit
R_AMO2015-07-14Vegetable
R_AMO2015-07-15Fruit
R_SSG2015-07-11Vegetable
R_SSG2015-07-12Fruit
R_SSG2015-07-12Vegetable
R_SSG2015-07-13Fruit
R_SSG2015-07-13Vegetable
R_SSG2015-07-14Fruit
R_SSG2015-07-15Fruit
R_SSG2015-07-15Vegetable
R_SSG2015-07-16Vegetable

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
sunny_talwar

Try this:

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

Capture.PNG

View solution in original post

6 Replies
sunny_talwar

Try this as your calculated dimension:

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

Capture.PNG

sibrulotte
Creator III
Creator III
Author

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...

Helpfull though thanks

sunny_talwar

Got it, working on it now

sunny_talwar

Try this:

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

Capture.PNG

sibrulotte
Creator III
Creator III
Author

that's a winner right there.

sunny_talwar

Awesome

Glad I was able to help.

Best,

Sunny