Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm new so tried here for the first time 🙂
I have a qvd like this :
A | B | C | date | nb |
TEXT1 | TEXT1 | TEXT1 | 10/01/2018 | 1 |
TEXT2 | TEXT2 | TEXT2 | 20/01/2018 | 1 |
TEXT2 | TEXT2 | TEXT2 | 21/01/2018 | 1 |
TEXT3 | TEXT3 | TEXT3 | 30/01/2018 | 1 |
TEXT3 | TEXT3 | TEXT3 | 30/01/2018 | 1 |
I would like to obtain the nb of minimum date :
A | B | C | =min(date) | nb of minimum date |
TEXT1 | TEXT1 | TEXT1 | 10/01/2018 | 1 |
TEXT2 | TEXT2 | TEXT2 | 20/02/2018 | 1 |
TEXT3 | TEXT3 | TEXT3 | 30/03/2018 | 2 |
I have tried this but it's not enough : Aggr(Min(date), A, B, C)
Do you know someting to do that ?
Data:
LOAD * INLINE [
A, B, C, date, nb
TEXT1, TEXT1, TEXT1, 10/01/2018, 1
TEXT2, TEXT2, TEXT2, 20/01/2018, 1
TEXT2, TEXT2, TEXT2, 21/01/2018, 1
TEXT3, TEXT3, TEXT3, 30/01/2018, 1
TEXT3, TEXT3, TEXT3, 30/01/2018, 1
];
output:
noconcatenate
load A,B,C, min(date) as min resident Data group by A,B,C;
left join load * resident Data;
drop table Data;
final:
noconcatenate
load if(date=min,1,0) as flag,* resident output;
drop table output;
First thank you for your solution.
I forget to mention explicitly I was trying to do this with Set Analysis and not in Script in order to calculate with a selected date in filter (pivot period)
Is there any possibility with Set Analysis (or not recommended) ?