# Get the lastest value from the same ID

Hi,

I'm newbie at tableau. I have a problem to get the lastest value from certain ID:

This the example of my case:

IDEventID
Date
Value
1E1Nov-134
E2Nov-157
E3Nov-184
2E4Nov-143
E5Nov-132
3E6Nov-186
E7Nov-172
4E8Nov-201
5E9Nov-216
6E10Nov-198

I was wondering how can we getthe value from the lastest date if an ID have more than 1 eventID. So for this example we should get:

IDEventID
Date
Value
1E3Nov-184
2E4Nov-143
3E6Nov-186
4E8Nov-201
5E9Nov-216
6E10Nov-198

sorry i can't give the original data because of the privacy matter, hope you all can understand.

Thanks

Randy

• ###### 1. Re: Get the lastest value from the same ID

Hi,

check the following link helps you.

Best Regards

Kumar

• ###### 2. Re: Get the lastest value from the same ID

Randy

If you have v9 you can use LoD...

Something like this, put on the filter, set to SHOW would work

IF [Date] = {FIXED ID: MAX([Date])} THEN 'SHOW' ELSE NULL END

Basically for every ID, we find the max date, we then test if that date is the same as the original (i.e. is it the max date?) if it is, we show/ display.

Cheers

Mark

• ###### 3. Re: Get the lastest value from the same ID

hi Mark, thanks a lot for your answer. Really helped a lot.

• ###### 4. Re: Get the lastest value from the same ID

hi kumar, thanks for information, i'll try to understand it because last time i used table calculation, I still confused about the function. Thanks anyway for sharing

• ###### 5. Re: Get the lastest value from the same ID

Hi all,

sorry to get this post up again, i got a problem when I applied Mark method.

this is the piece of my data

The red circled was the problem, it's not showing the 'SHOW' things

this is the "Last Date Show" formula based from Mark reply:

if [Date] = {FIXED [Panelistid]:MAX([Date])} THEN 'SHOW'

ELSE NULL

END

Sorry i cannot share the data, because this data came from the real one, and i have to erase some data to show it here.

Thanks

Randy

• ###### 6. Re: Get the lastest value from the same ID

Randy

Currently you are getting Latest date of each [Panelistid].  If this is your inatent, could you put "Last Date Show" field in filter shelf and filter out "Null".

But if you need the Last date by Event ID, change the formula

"Last Date Show"

if [Date] = {FIXED [Panelistid],[Event ID]:MAX([Date])} THEN 'SHOW'

ELSE NULL

END

Thanks,

Shin

• ###### 7. Re: Get the lastest value from the same ID

Hi Shin,

Yes, the purpose is to get a 'SHOW' value for each panelists where the Date is the lastest for each panelists. I also tried your suggestion to combined it with [Event ID], but result is showing 'SHOW' value for all data.

I also tried it in a simple data from excel, but it worked well. I attached the .twbx for the dummy data.

The problem is, from the data that i showed with screenshot. I believe panelists 244196, should have 'SHOW' value for second eventID, so do panelists 253487, also should have 'SHOW' value for 4th event ID, what event strange is panelists 254595 didn't show 'SHOW' value even it only have 1 eventID.

I wonder what wrong with the formula or the data?

Thanks

Randy