Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If Status -1, clone the fields cod, date, status, id, qty. Changing the Status to '0', and Qty 'Positive'
If the Status is -1, it duplicates the line, changing it to positive.
Edit Qty and Status to positive and duplicate the line
id, date, status, ordem, qtde
2360 | 12/11/2012 17:33:13 | -1 | 201221 | -24 |
2360 | 12/11/2012 17:33:13 | -1 | 201222 | -84 |
2360 | 12/11/2013 17:38:13 | -1 | 201228 | -24 |
2360 | 12/11/2013 17:38:13 | -1 | 201227 | -84 |
How should it look
cod | date | Status | id | qtde |
2360 | 11/12/2012 17:33 | -1 | 201221 | -24 |
2360 | 11/12/2012 17:33 | -1 | 201222 | -84 |
2360 | 11/12/2013 17:38 | -1 | 201228 | -24 |
2360 | 11/12/2013 17:38 | -1 | 201227 | -84 |
2360 | 11/12/2012 17:33 | 0 | 201221 | 24 |
2360 | 11/12/2012 17:33 | 0 | 201222 | 84 |
2360 | 11/12/2013 17:38 | 0 | 201228 | 24 |
2360 | 11/12/2013 17:38 | 0 | 201227 | 84 |
Hi, do this.
Data:
LOAD id,
date,
status,
ordem,
qtde
FROM SourceTable;
Positives:
LOAD id,
date,
not Sign(status) as status,
ordem,
Fabs(qtde) as qtde
Resident Data
Where status = -1;
Hi, do this.
Data:
LOAD id,
date,
status,
ordem,
qtde
FROM SourceTable;
Positives:
LOAD id,
date,
not Sign(status) as status,
ordem,
Fabs(qtde) as qtde
Resident Data
Where status = -1;
Hi
Try like below
Source:
Load id, date, status, ordem, qtde from ursource;
Load id, date, 0 as status, ordem, fabs(qtde) as qtde resident Source where status = -1;
BrunPierre ,
If Status -1, clone the fields cod, date, status, id, qty. Changing the Status to '0', and Qty 'Positive'
I would like to leave the lines negative and duplicate the records and leave both, as in the example below
cod | date | Status | id | qtde |
2360 | 11/12/2012 17:33 | -1 | 201221 | -24 |
2360 | 11/12/2012 17:33 | -1 | 201222 | -84 |
2360 | 11/12/2013 17:38 | -1 | 201228 | -24 |
2360 | 11/12/2013 17:38 | -1 | 201227 | -84 |
2360 | 11/12/2012 17:33 | 0 | 201221 | 24 |
2360 | 11/12/2012 17:33 | 0 | 201222 | 84 |
2360 | 11/12/2013 17:38 | 0 | 201228 | 24 |
2360 | 11/12/2013 17:38 | 0 | 201227 | 84 |
I would like to leave the lines negative and duplicate the records and leave both, as in the example below
cod | date | Status | id | qtde |
2360 | 11/12/2012 17:33 | -1 | 201221 | -24 |
2360 | 11/12/2012 17:33 | -1 | 201222 | -84 |
2360 | 11/12/2013 17:38 | -1 | 201228 | -24 |
2360 | 11/12/2013 17:38 | -1 | 201227 | -84 |
2360 | 11/12/2012 17:33 | 0 | 201221 | 24 |
2360 | 11/12/2012 17:33 | 0 | 201222 | 84 |
2360 | 11/12/2013 17:38 | 0 | 201228 | 24 |
2360 | 11/12/2013 17:38 | 0 | 201227 | 84 |
@Paula1 For me, it definitely works well.
Data:
LOAD id,
date,
datex,
status,
ordem,
qtde
FROM SourceTable;
Positives:
LOAD id,
date,
datex,
not Sign(status) as status,
ordem,
Fabs(qtde) as qtde
Resident Data
Where status = -1;
How do I change the date to datax in this script that is correct.
cod | date | datex | Status | id | qtde |
2360 | 11/12/2012 17:33 | 15/12/2012 17:33 | -1 | 201221 | -24 |
2360 | 11/12/2012 17:33 | 15/12/2012 17:33 | -1 | 201222 | -84 |
2360 | 11/12/2013 17:38 | 15/12/2013 17:38 | -1 | 201228 | -24 |
2360 | 11/12/2013 17:38 | 15/12/2013 17:38 | -1 | 201227 | -84 |
2360 | 15/12/2012 17:33 | 15/12/2012 17:33 | 0 | 201221 | 24 |
2360 | 15/12/2012 17:33 | 15/12/2012 17:33 | 0 | 201222 | 84 |
2360 | 15/12/2013 17:38 | 15/12/2013 17:38 | 0 | 201228 | 24 |
2360 | 15/12/2013 17:38 | 15/12/2013 17:38 | 0 | 201227 | 84 |