Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
The data in the table looks something like this.
| Item | Value | Qty |
| A | 10 | 20 |
| B | 11 | 23 |
| 1-A | 12 | 13 |
| 1-B | 15 | 16 |
The data in the result table add the numbers for values and qty for similar items and produce something like this.
| Item | Value | Qty |
| A | 22 | 33 |
| B | 26 | 39 |
| 1-A | 12 | 13 |
| 1-B | 15 | 16 |
The Value of A is the result of summing up the Value of A and A1, i.e.,
10 + 12 = 22.
The other calculations are done in the same way.
Thanks,
Hi, try something like:
temp:
LOAD * INLINE [
Item|Value|Qty
A|10|20
B|11|23
1-A|12|13
1-B|15|16
] (DELIMITER IS '|');
temp_conc:
NOCONCATENATE
LOAD
SUBFIELD(Item,'-',2) as Item,
Value,
Qty
RESIDENT temp;
INNER JOIN (temp_conc)
LOAD
FIELDVALUE('Item',RECNO()) AS Item
AUTOGENERATE FIELDVALUECOUNT('Item');
CONCATENATE (temp)
LOAD * RESIDENT temp_conc;
DROP TABLE temp_conc;
and then in the frontend just sum the measures:
Hi, try something like:
temp:
LOAD * INLINE [
Item|Value|Qty
A|10|20
B|11|23
1-A|12|13
1-B|15|16
] (DELIMITER IS '|');
temp_conc:
NOCONCATENATE
LOAD
SUBFIELD(Item,'-',2) as Item,
Value,
Qty
RESIDENT temp;
INNER JOIN (temp_conc)
LOAD
FIELDVALUE('Item',RECNO()) AS Item
AUTOGENERATE FIELDVALUECOUNT('Item');
CONCATENATE (temp)
LOAD * RESIDENT temp_conc;
DROP TABLE temp_conc;
and then in the frontend just sum the measures: