Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

DateTime Comparison in Set Analysis

Hi All

I have scenario where I have 2 DateTime fields and I would like to compare the two to retrieve a value. I tried set analysis but it doesn't seem to work.

In this case I only want to return the latest "Card_Allocation_DateTime" where "Shift_DateTime" is greater than "Card_Allocation_DateTime". How can this be done?

Please see my qvw and spreadsheet (with source data and desired results)

1 Solution

Accepted Solutions
rubenmarin

Hi Tumelo, can you try this expression?

If(Card_Allocation_DateTime=Max(TOTAL <Card_ID> Card_Allocation_DateTime)

and Shift_DateTime<Max(TOTAL <Card_ID> Card_Allocation_DateTime), Max(TOTAL <Card_ID> Card_Allocation_DateTime))

View solution in original post

8 Replies
Anonymous
Not applicable
Author

Hi Tumelo,

This is better to do with If: Max(TOTAL <Card_ID,Shift_DateTime>  If(Shift_DateTime>Card_Allocation_DateTime, Card_Allocation_DateTime))

Kind regards!

Not applicable
Author

Hi Manuel

This doesn't work either, can you please attach an app?

Anonymous
Not applicable
Author

Hi Tumelo,

See attached file.

Regards

Not applicable
Author

Thanks for the reply manuel

But the expression returns Null. I would like it to give me something like this...

     

Shift_DateTimeCard_IDCard_AllocationStatusCard_AllocationReasonCard_Allocation_DateTime
2014/07/08 12:58:2374402Card Allocated2016/03/27 17:03:25
rubenmarin

Hi Tumelo, can you try this expression?

If(Card_Allocation_DateTime=Max(TOTAL <Card_ID> Card_Allocation_DateTime)

and Shift_DateTime<Max(TOTAL <Card_ID> Card_Allocation_DateTime), Max(TOTAL <Card_ID> Card_Allocation_DateTime))

Anonymous
Not applicable
Author

Returns Null because all dates on Card_Allocation_DateTime are greater of Shift_DateTime, there aren't any date where Shift_DateTime > Card_Allocation_DateTime.

If you want to show last Card_Allocation_DateTime > Shift_DateTime, then Max(TOTAL <Card_ID,Shift_DateTime>  If(Shift_DateTime<Card_Allocation_DateTime, Card_Allocation_DateTime)).

Your requirement say: return the latest "Card_Allocation_DateTime" where "Shift_DateTime" is greater than "Card_Allocation_DateTime", and you want: return the latest "Card_Allocation_DateTime" where "Card_Allocation_DateTime" is greater than "Shift_DateTime"


Regards!

Not applicable
Author

Thanks Ruben, this is perfect

Not applicable
Author

Sorry Manuel, I didn't ask correctly but thanks a lot for your help