Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
i have two tables structured as below:
MAPPING_TABLE:
| MapKey | MapFormula |
|---|---|
| a | Field1+Field2+Field3 |
| b | Field1+Field2+Field3 |
| c | Field1+Field2+Field3 |
| d | Field1+Field2+Field3 |
FACT_TABLE:
| Key | Field1 | Field2 | Field3 |
|---|---|---|---|
| a | 1 | 1 | 1 |
| b | 2 | 2 | 2 |
| c | 3 | 3 | 3 |
| d | 4 | 4 | 4 |
and i would like to use the declared formulas on this mapping table to obtain resulst on another table...so:
MAPPING_TABLE:
Mapping
Load
MapKey,
MapFormula
From MAPPING_TABLE.xls;
FACT_TABLE:
LoadKey,
Field1,
Field2,
Field3,
Applymap('MAPPING_TABLE',Key) as Result
From FACT_TABLE.qvd(qvd);
but the resut is
| Key | Result |
|---|---|
| a | Field1+Field2+Field3 |
| b | Field1+Field2+Field3 |
| c | Field1+Field2+Field3 |
| d | Field1+Field2+Field3 |
and i would like to obtain:
| Key | Result |
|---|---|
| a | 3 |
| b | 6 |
| c | 9 |
| d | 12 |
Any idea ?
Are you trying to obtain a cumulative field from the mapping table?
look at these examples using just the data table, see if these help
No,
i don't want to obtain a cumulative result.
I want to specify a formula (Ex. sum(Field1+Field2+Field3)) on the mapping table and then use applymap() to calculate the result of the formula by using the Field1, Field2, Field3 of my final table.