Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to make Balance in the Ant and Final
By Code, Date Time,
Any suggestion
Data Hora | Cod | Tipo | Ant. | E | S | Final |
418 | 119 | |||||
21/12/2000 00:00:00 | 9147 | E | 0 | 12 | 0 | 12 |
21/12/2000 00:00:00 | 9148 | E | 0 | 47 | 0 | 47 |
05/01/2008 00:00:00 | 9147 | S | 0 | 0 | 1 | -1 |
05/01/2008 00:00:00 | 9148 | S | 0 | 0 | 1 | -1 |
08/01/2008 09:22:06 | 9148 | S | 0 | 0 | 99 | -99 |
08/01/2008 09:22:06 | 9147 | S | 0 | 0 | 18 | -18 |
13/01/2010 13:51:30 | 9147 | E | 0 | 124 | 0 | 124 |
13/01/2010 13:51:30 | 9148 | E | 0 | 235 | 0 | 235 |
Example code 9147,
I would like everyone's balance, follow the example spreadsheet.
Data Hora | Cod | Tipo | Ant. | E | S | Final |
418 | 119 | |||||
21/12/2000 00:00:00 | 9147 | E | 0 | 12 | 0 | 12 |
05/01/2008 00:00:00 | 9147 | S | 12 | 0 | 1 | 11 |
08/01/2008 09:22:06 | 9147 | S | 11 | 0 | 18 | -7 |
13/01/2010 13:51:30 | 9147 | E | -7 | 124 | 0 | 117 |
You can try this
Table1:
LOAD
[Data Hora],
Cod,
Tipo,
Ant,
E,
S,
Final
FROM [your_data_source.csv]
(ooxml, embedded labels, table i
s Sheet1);
Table2:
LOAD
[Data Hora],
Cod,
Tipo,
Ant,
E,
S,
Final,
if(Tipo = 'E', Peek('Final') + E - S, Peek('Final')) as Balance
Resident Table1
Order by Cod, [
Data Hora];