Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I have a requirement of fetching the Customer_ID with the latest time stamp, what ever being the ITEM he had purchased.
Header 1 | Header 2 | Header 3 |
---|---|---|
ID | ITEM | TIME_STAMP |
123 | BOOKS | 8/18/2015 13:11 |
123 | PEN | 8/18/2015 13:58 |
123 | PENCIL | 8/19/2015 15:55 |
999 | PEN | 7/17/2013 16:44 |
777 | BOOKS | 7/27/2015 19:25 |
777 | PENCIL | 7/29/2015 12:01 |
777 | BOOKS | 7/29/2015 12:01 |
I HAVE TO DISPLAY THE RECORD BASED ON LATEST TIMESTAMP IN A STRAIGHT TABLE.
please can any one help...!!!
Thanks in Advance
Straight Table
Dimension
ID
Expression
1) Max(TIME_STAMP)
2) FirstSortedValue(ITEM,-TIME_STAMP)
Hi Manish Kachhia
I have already tried that,any other way please check the output as below
if it has same time stamp it should pick up last value and it should not be blank.
Duplicate of getting the latest record based on time stamp
if(max(TIME_STAMP)=max(TOTAL TIME_STAMP), max(TIME_STAMP))
t:
load ID, ITEM, Timestamp(Timestamp#(TIME_STAMP, 'MM/DD/YYYY hh:mm')) as TIME_STAMP
inline [
ID, ITEM, TIME_STAMP
123, BOOKS, 8/18/2015 13:11
123, PEN, 8/18/2015 13:58
123, PENCIL, 8/19/2015 15:55
999, PEN, 7/17/2013 16:44
777, BOOKS, 7/27/2015 19:25
777, PENCIL, 7/29/2015 12:01
777, BOOKS, 7/29/2015 12:01
];
Hi Maxgro,
I agree what you meant but how do i get other customer Id
you have shown only ID 123 how about others. please can you check once
FirstSortedValue(DISTINCT ITEM, -TIME_STAMP)
Thanks
if(max(TIME_STAMP)=max(TOTAL <ID> TIME_STAMP), max(TIME_STAMP))
Hi Manish,
please can you look more in detail please, its not accepting DISTINCT and it says expression OK