How are you determining "last" in this context. I see that the sample data you provided, the values are not in any particular order. Does the dataset have some kind of ordinality?
Tableau doesn't have any kind of built in understanding of order or records in the dataset, so for "Last 4 records" kind of logic to work, you have to have some kind surrogate that indicates order for the records. Usually this comes in the form of a datetime field or sequential numbering coming from the data source.
Yes the values are not in particular order and the values are dynamic in nature.i just dont want to hard code the members
Yeah, so "last" 4 will be impossible with data that looks like that from Tableau's perspective. Biggest four? Easy peasey. Last four? Notsomuch.
What is your data source? It may be a simple thing to add a calculation that allows such functionality to the query, depending on the data source.