Hi
I need help figuring out the correct expression (if at all possible) for the following case.
I have a datawindow
Each row have:
column1 which will have A B C or D as value
column2 a decimal value
In the header I want a compute to display a value depending and the column1 of the first line which I can do by testing first(column1 for all)
Now this is where it gets tricky
if column1 = "A" or "B" then column2 from row 1
if column2 = "C" then column2 from the first line where column1 is either "A" or "B"
if column2 = "D" then 0
I can't figure out the "then" part of the = "C" part.
I know I can do it without a compute with some code but I'd really like to have everything inside the DW in this case.
We're using PB 2017 R3
Thanks in advance for any usefull tip.
Regards
I did it with less computed field
on the detail I added a computed field named compute_valorisation
if
(
type_valorisation = "D" or type_valorisation = "V"
, valeur_totale
, if
(
type_valorisation = "C" and bool_cession_totale = "V"
, 0
, dec(describe('evaluate("compute_valorisation",'+string(getrow()+1)+')')) - valeur_totale
)
)
I won't have a problem with the getrow() + 1 because the last row of the datawindow always have the same "column1"
if my header I just used a first(compute_valorisation for all)