Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
i want to retrive date field when a specific atribute has changed,
table looks somthing like below
id | date from | date to | atribute a | atribute b | atrubute c |
123 | 01\01\17 | 28\02\17 | aa | bb | cc |
123 | 01\03\17 | 15\05\17 | ab | bb | cc |
123 | 16\05\17 | 30\06\17 | ab | bz | cc |
123 | 01\07\17 | 01\10\17 | ab | bz | cr |
i want the 'date from' value where atribute a changed from aa to ab (01\03\17)
prefer doing it in the script
any ideas?
advanced thanks
Previous function might work for you:
Previous function might work for you:
Temp1:
Load * Inline
[
id, date from, date to, atribute a, atribute b, atrubute c
123, 01\01\17, 28\02\17, aa, bb, cc,
123, 01\03\17, 15\05\17, ab, bb, cc,
123, 16\05\17, 30\06\17, ab, bz, cc,
123, 01\07\17, 01\10\17, ab, bz, cr,
];
NoConcatenate
Load
id,
[date from],
[atribute a],
If(RowNo() >1, If([atribute a] = previous([atribute a]),Null(), [date from])) as test
Resident
Temp1;
drop table Temp1;