Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
ID | Date | SEX | AGE | Product | Purchased |
1 | 07/30/2012 | F | 11 | Pen | Yes |
Pencil | |||||
Book | |||||
2 | 05/07/2012 | M | 10 | pen | No |
3 | 01/04/2012 | F | 45 | Pen | Yes |
Pencil | |||||
Book | |||||
marker |
Is there a way I could get something similar to below output:
ID | Date | SEX | AGE | Product | Purchased |
1 | 07/30/2012 | F | 11 | Pen | Yes |
1 | 07/30/2012 | F | 11 | Pencil | Yes |
1 | 07/30/2012 | F | 11 | Book | Yes |
2 | 05/07/2012 | M | 10 | pen | No |
3 | 01/04/2012 | F | 45 | Pen | Yes |
3 | 01/04/2012 | F | 45 | Pencil | Yes |
3 | 01/04/2012 | F | 45 | Book | Yes |
3 | 01/04/2012 | F | 45 | marker | Yes |
If the values are null you could do this :
Load If(isnull(ID) , peek(NewID), ID) as NewID,
If(isnull(Date), peek(NewDate), Date) as NewDate,
If(isnull(SEX), peek(NewSEX), SEX) as NewSex,
If(isnull(AGE), peek(NewAGE), AGE) as NewAGE,
Product,
If(isnull(Purchased), peek(NewPurchased), Purchased) as NewPurchased
from .....;
Or if there is a space you might try If(len(trim(ID))=0, Null(), ID) as NewID
If the values are null you could do this :
Load If(isnull(ID) , peek(NewID), ID) as NewID,
If(isnull(Date), peek(NewDate), Date) as NewDate,
If(isnull(SEX), peek(NewSEX), SEX) as NewSex,
If(isnull(AGE), peek(NewAGE), AGE) as NewAGE,
Product,
If(isnull(Purchased), peek(NewPurchased), Purchased) as NewPurchased
from .....;
Or if there is a space you might try If(len(trim(ID))=0, Null(), ID) as NewID