Get the latest date based on reference ID

Monns
New Member

I am basically trying to get the number of days between the latest date from the reference table and the current date. I thought MAX was supposed to get me the latest date through the last id match but I only get the first one.

This is my formula:
CONCATENATE(HOUR (Today() - MAX(SELECT(Contact_txn[Date], [id] = [ContactRec])))/24, " Days Ago")

The concatenation of all these text values (
โ€ฆ(HOUR(
โ€ฆ(TODAY() - MAX(
โ€ฆThe list of values of column โ€˜Dateโ€™
โ€ฆfrom rows of table โ€˜CONTACT_TXNโ€™
โ€ฆwhere this condition is true: ((The value of column โ€˜idโ€™) is equal to (The value of column โ€˜ContactRecโ€™)))) / 24
โ€ฆ" Days Ago"

3X_f_6_f6d4b9f32234dfc212c58e6c4ca28cb2b9f8e6f0.png

I am not sure what I am missing. Any help would be appreciated.

Solved Solved
0 4 753
1 ACCEPTED SOLUTION

Try this instead:

SELECT(Contact_txn[Date], [_THISROW].[id] = [ContactRec])

View solution in original post

4 REPLIES 4

Steve
Platinum 4
Platinum 4

What is this supposed to be doing?

SELECT(Contact_txn[Date], [id] = [ContactRec])

I believe it is supposed to grab the date(From Table B) on the row that has the id value(From Table A) matching ContactRec value (Ref on Table B)

Try this instead:

SELECT(Contact_txn[Date], [_THISROW].[id] = [ContactRec])

Worked like a charm, thank you!

Top Labels in this Space