Need help with the correct expression to calculate based on column types

I need help writing the expression to calculate (sum) a row:

I need:

If โ€œColumn Typeโ€ = โ€œSales/Invoiceโ€ [Current Trx Amount] - [Current Trx Amount] (if the โ€œColumn Typeโ€ is โ€œCredit Memosโ€.

Here is what i currently have (It is a TRAIN wreck - I know!!!):

IFS( [Document Type] = โ€œSales / Invoicesโ€,

[Current Trx Amount] - IFS( [Document Type] = โ€œCredit Memosโ€, [Current Trx Amount])
)
)

Here is the table (example) showing the raw data i need to calculate:

Thanks

0 14 469
14 REPLIES 14

Steve
Platinum 4
Platinum 4

Your expressions look valid to me. Of course, I have no idea what youโ€™re trying to accomplish. Please explain what youโ€™re trying to do in plain language.

Sorry, Yes.

So i need to calculate Sum. The sum should take all โ€œSales / Invoiceโ€ - โ€œCredit Memosโ€ - for that current time (from date column)

So from this example:

I would need:
0-30 Days (Based on Date): $16,000 - $16,000 = $0
Over 90 Days: $943,252

I want to add:
Both โ€œSales / Invoiceโ€ and โ€œCredit Memoโ€ will use the value in โ€œCurrent Trx Amountโ€ to calculate the expression.

What is โ€œthat current timeโ€? How is the โ€œcurrent timeโ€ determined and/or recognized?

Where did $943,252 come from for over 90 days?

Sales / Invoices should always be additions? Credit memos always subtractions?

What is โ€œthat current timeโ€? How is the โ€œcurrent timeโ€ determined and/or recognized?
This is the column โ€œDocument Dateโ€ - Always given

Where did $943,252 come from for over 90 days?
This means $943,252 hasnt been paid since over 90 days ago - determined by the column โ€œDocument Dateโ€

Sales / Invoices should always be additions? Credit memos always subtractions?
Yes and Yes

None of the columns in your screenshot have names.

Sorry:
the table is VERY large:

I cannot get a snapshot of those rows showing the top columns names

Where will the result be computed and saved?

a VC.

In the same table? Thatโ€™s going to be hugely expensive!

uh oh. Yes i hoped.

Iโ€™m afraid Iโ€™m unwilling to help with this. Your data model is fundamentally flawed and will result in crippling performance problems over time. Iโ€™m not going to contribute to that.

oh no. Do you have suggestions of changing the model?

Do you have suggestions of changing the model?

Steve,
What if i do the calculations in the google sheet instead? I would add more columns (0-30 Days, etcโ€ฆ)?

Top Labels in this Space