Hi,
I have a calculated field that increments by document type and it is working well but I dont want just numbers. I wanto concatinate it with a letter based on the document type.
But my calculated field returns me a “mismatch aggregation error”.
How to fix this?
1 Like
Hello @pantelis, your calculated field is just formatted a bit incorrectly. You are nesting too many ifelse statements, and not closing them out properly. Instead, you can reformat this calculation with a single calculated field and add a PRE_AGG calculation level to the denseRank to avoid any errors in the field. It would look like this:
ifelse(
{dt_document_type} = "INVOICE SERVICES", concat('A', toString(denseRank([{company_id} ASC, {calendar} ASC], [{dt_document_type}], PRE_AGG))),
{dt_document_type} = "INVOICE SERVICES E.U", concat('B', toString(denseRank([{company_id} ASC, {calendar} ASC], [{dt_document_type}], PRE_AGG))),
{dt_document_type} = "INVOICE SERVICES non E.U", concat('C', toString(denseRank([{company_id} ASC, {calendar} ASC], [{dt_document_type}], PRE_AGG))),
NULL
)
That should resolve the issue you are facing! Let me know if you have any questions.
Hi @DylanM . Yes it worked just fine. Many thanks
1 Like