Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There,
I would like to find out the number of days difference by dimension (ID). Example as below.
ID | DATE | DESC | Days DIFFERENCE |
A123 | 1/01/2020 | Work in Progress | Null |
A123 | 10/02/2020 | COMPLETE | 40 |
A124 | 1/03/2020 | Work in Progress | Null |
A124 | 1/03/2023 | COMPLETE | 1095 |
Hi, try this,
LOAD ID,
DATE,
DESC,
If(DESC = 'COMPLETE', Interval(DATE - Peek(DATE), 'd'), 'Null') as Days_DIFFERENCE
RESIDENT YourTable
ORDER BY ID, DATE ASC;
If it works, please mark this as a solution.
Replace YourTable with your exact table name;
Hi, try this,
LOAD ID,
DATE,
DESC,
If(DESC = 'COMPLETE', Interval(DATE - Peek(DATE), 'd'), 'Null') as Days_DIFFERENCE
RESIDENT YourTable
ORDER BY ID, DATE ASC;
If it works, please mark this as a solution.
Replace YourTable with your exact table name;