you will have to build a FOR ... TO loop for such a thing:
- First you do a FIRST 1 LOAD with those three fields you want in your new table
- Then you do such a loop with the NoOfRows() function (rows in your original table) as the max (so it will read
>> FOR i = 0 TO (NoOfRows('[table]')-1) <<
- In every iteration, you can use the CONCATENATE option to append the current Code_H and T1_Key to this table
=> After the loop has completed, you should have the same nr. of rows as in your original table (plus 1, which is the empty row you have extracted for a dummy, you can throw this out now)
the T1-Key is already calculated in the Script.
[The PivotTable show the turnover in one column and the other column show the T1-Key.]
I now want to write the result of the calculation as value into a new table with the 3 columns mentioned above (CODE_H_Code, T1-Key and Year-Period).
The Advantage of that would be a table with all keys for all month that I can easily use whenever I want without duplicating that Formular in every Report (Pivot).
I will attach for you the file I use. The Sheet Umsatz PL10xxx (Filtered on DEDETDEC) shows the database.
Maybe this will help to understand.
Very much thanks in advance.
IFS_Struktur.qvw 455.2 K
I don't think the T1_Key value is precalculated in the script. There is a SET statement in tab Keys, but that doesn't do anything except setting a variable to a string value. The actual calculation will be done in the Pivot Table object.
I think the best way to approach this chalenge is to copy fields Valuehome, E14 and Docdate of all rows from PL10110_Umsatzbuchungen into a new table in your script. Then create a mapping table that maps E14 to CODE_H_CODE in Fire.xls_Budgetgruppen. Now add CODE_H_CODE to your new internal table. You may have to drop all rows that have no mapping, but that depends on which transactions should be included in your table.
Then perform a RESIDENT LOAD of Sum(Valuehome) with a GROUP BY on CODE_H_CODE and your preferred translation of Docdate (MonthYear or something).
Next calculate a variable that sums the value of Valuehome in all rows. Call it vTotalSum.
Reload your new table and add ValueHome / vTotalSum as T1_Key.
Is this something you can work on? If not, just ask. I don't have enough information (or data, or time) to do it myself in your document, but it doesn't look that difficult.
I have to think about this.
At the Moment it is not clear to me, why do I have to load twice.
At the Moment there are only Sales loaded. The costs will follow later.
At exactly this costs which dont have El4 have to be splitted to CODE_H_Code.
That is the reason why I want to calculate this keys from the one database,, without loading twice.
Do you think this is possible.