Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Sirs ,
What should be script the get result column of below data ?
Result - first value of result to be 1 and rest other 0 , while all distinct data to be 1 as well .
Duplicates:
LOAD * INLINE [
Input
Aquafina - 1000
Aquafina - 1000
Aquafina - 1002
Aquafina - 998
Aquafina - 999
Aquafina - 999
Aquafina - 999
Aquafina - 999
Aquafina - 999
Bisleri1
Bisleri1
Bisleri1
Bisleri1
Bisleri1
Bisleri2
Bisleri3
MAZA-FRITZO1
MAZA-FRITZO2
MAZA-FRITZO3
MAZA-FRITZO4
MAZA-FRITZO4
MAZA-FRITZO6
];
Thanking in advance .
Try this
Duplicates:
LOAD RowNo() as RowNum,
*,
If(Input = Previous(Input), 0, 1) as Result;
LOAD * INLINE [
Input
Aquafina - 1000
Aquafina - 1000
Aquafina - 1002
Aquafina - 998
Aquafina - 999
Aquafina - 999
Aquafina - 999
Aquafina - 999
Aquafina - 999
Bisleri1
Bisleri1
Bisleri1
Bisleri1
Bisleri1
Bisleri2
Bisleri3
MAZA-FRITZO1
MAZA-FRITZO2
MAZA-FRITZO3
MAZA-FRITZO4
MAZA-FRITZO4
MAZA-FRITZO6
];
Little changing and not working
I guess sort the data in a resident load and then apply the If... previous logic...