Hi, does anyone understand what the `View Type` pa...
# suiteql
m
Hi, does anyone understand what the
View Type
parameter does in BUILTIN.CONSOLIDATE?
m
We always use INCOME
Copy code
BUILTIN.CONSOLIDATE(
                    transactionAccountingLine.amount,
                    'INCOME',
                    'DEFAULT',
                    'DEFAULT',
                    ${subsidiaryId},
                    transaction.postingPeriod,
                    'DEFAULT'
                  )
s
m
Thanks @Matt Bernstein. I tried creating a workbook in the UI with both consolidated and original currency and exported the SuiteQL. Looks like NetSuite actually uses 'LEDGER' for the consolidated one (and for some reason still uses BUILTIN.CONSOLIDATE but with a target subsidiary of 0 for the original amount)
Copy code
/* original amount */

BUILTIN_RESULT.TYPE_CURRENCY(
	BUILTIN.CONSOLIDATE(TransactionAccountingLine.amount, 'INCOME', 'NONE', 'DEFAULT', 0, 0, 'DEFAULT'),
	BUILTIN.CURRENCY(BUILTIN.CONSOLIDATE(TransactionAccountingLine.amount, 'INCOME', 'NONE', 'DEFAULT', 0, 0, 'DEFAULT'))
) AS amount, 

/* consolidated amount */

BUILTIN_RESULT.TYPE_CURRENCY(
	BUILTIN.CONSOLIDATE(TransactionAccountingLine.amount, 'LEDGER', 'DEFAULT', 'DEFAULT', 3, 355, 'DEFAULT'),
	BUILTIN.CURRENCY(BUILTIN.CONSOLIDATE(TransactionAccountingLine.amount, 'LEDGER', 'DEFAULT', 'DEFAULT', 3, 355, 'DEFAULT'))
) AS amount_1