Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
in order to build a balance sheet i need to built a new field to decide where the figures is been showed (income or expenses).
The way to solve this is a little bit complex. I have several tables which i joined together to one Fact Table (tbh it looks good).
Example:
Customer = 4711
accountno.= 15000
year= 2020
value: 700.000
Because this accountno. appears in income AND expenses i need a flag to choose where it should show up.
The flag logic is:
if(
if(starvalue_flag= 'H',startvalue*-1,startvalue)
+
(sum_value-sum_value)
>0,'Income','Expenses')
The startvalue is on a yearly level and "sum_value" on a periodic (mostly monthly) level.
So i guess i need that flag on a periodic level per customer and accountno.
Should i build a loop in script with that logic, that generates this new flag field?
How should it look like?
Thanks