IosifFlorin
New Member
- Joined
- Jul 1, 2015
- Messages
- 18
Hello! I am trying to write a new function because only with formulas is too complicated and inefficient
Important: the comparison of the prices have to start with the most aggressive band in table 2 (which is the one most to the right, not left).
In CurrentBand i have the some examples of answer
I want to extend the function, this is just and example but the names of the headers are with these specifics, but would be really helpful to get the blueprint which i could expand afterwards
TableProd
[TABLE="class: grid, width: 400"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]ProductCode[/TD]
[TD]Price /Unit[/TD]
[TD]Price /Box[/TD]
[TD]Current Band[/TD]
[/TR]
[TR]
[TD]Prod1[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]50 [/TD]
[TD] Jupiter[/TD]
[/TR]
[TR]
[TD]Prod2[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]125 [/TD]
[TD] Saturn[/TD]
[/TR]
[TR]
[TD]Prod3[/TD]
[TD="align: right"]53[/TD]
[TD="align: right"]265 [/TD]
[TD]Between Saturn and Jupiter[/TD]
[/TR]
[TR]
[TD]Prod4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]25 [/TD]
[TD] < Jupiter[/TD]
[/TR]
</tbody>[/TABLE]
Banding Table
[TABLE="class: grid, width: 457"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]ProductCode[/TD]
[TD]Venus /Unit[/TD]
[TD]Mars /Unit[/TD]
[TD]Saturn /Unit[/TD]
[TD]Jupiter /Unit[/TD]
[/TR]
[TR]
[TD]Prod1[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Prod2[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Prod3[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]75[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Prod4[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]
- i have 2 tables (names below)
- in the TableProd, header Current Band i want to find out where is positioned in the Banding Table (table 2) the Price for a certain Product.
- i am using the tables to make it easier for referencing
Important: the comparison of the prices have to start with the most aggressive band in table 2 (which is the one most to the right, not left).
In CurrentBand i have the some examples of answer
I want to extend the function, this is just and example but the names of the headers are with these specifics, but would be really helpful to get the blueprint which i could expand afterwards
TableProd
[TABLE="class: grid, width: 400"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]ProductCode[/TD]
[TD]Price /Unit[/TD]
[TD]Price /Box[/TD]
[TD]Current Band[/TD]
[/TR]
[TR]
[TD]Prod1[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]50 [/TD]
[TD] Jupiter[/TD]
[/TR]
[TR]
[TD]Prod2[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]125 [/TD]
[TD] Saturn[/TD]
[/TR]
[TR]
[TD]Prod3[/TD]
[TD="align: right"]53[/TD]
[TD="align: right"]265 [/TD]
[TD]Between Saturn and Jupiter[/TD]
[/TR]
[TR]
[TD]Prod4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]25 [/TD]
[TD] < Jupiter[/TD]
[/TR]
</tbody>[/TABLE]
Banding Table
[TABLE="class: grid, width: 457"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]ProductCode[/TD]
[TD]Venus /Unit[/TD]
[TD]Mars /Unit[/TD]
[TD]Saturn /Unit[/TD]
[TD]Jupiter /Unit[/TD]
[/TR]
[TR]
[TD]Prod1[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Prod2[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Prod3[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]75[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]Prod4[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]