Skip to main content

Hello,

I'm trying to make the DSO indicator, but I need to get data from several tables and I'm having problems...
The DSO formula is made up of two parts, Revenue and Accounts Receivable. I need to calculate each one individually and then divide one by the other.

I'll use the example of Accounts Receivable:
Quando eu uso os campos de Filtro, com os seguintes filtros, funciona sem problemas:

FILTER "o_celonis_SalesOrder"."CompanyCodeText" IN ('CompanyNameZYX');
FILTER "o_celonis_SalesOrder"."SalesDocumentType" IN ('XXXX', 'YYYY');
FILTER "o_custom_CustomerAccountItem"."BaselineDate" <= {t ${end_date}};
FILTER "o_custom_CustomerAccountItem"."ClearingDate" > {t ${end_date}} OR "o_custom_CustomerAccountItem"."ClearingDate" IS NULL

However, when I try to place the same filters in Case when, to generate the indicator that will be combined with Billing, there is a connection problem between the tables (o_celonis_SalesOrder and o_custom_CustomerAccountItem).

sum(
CASE WHEN
"o_celonis_SalesOrder"."CompanyCodeText" IN ('CompanyNameZYX')
AND
"o_celonis_SalesOrder"."SalesDocumentType" IN ('XXXX', 'YYYY')
AND
"o_custom_CustomerAccountItem"."BaselineDate" <= {t ${end_date}}
AND
(
"o_custom_CustomerAccountItem"."ClearingDate" > {t ${end_date}}
OR
"o_custom_CustomerAccountItem"."ClearingDate" IS NULL
)
THEN "o_custom_CustomerAccountItem"."valor"
ELSE 0
END
)


Just to make it clear that the formulas are "the same", except that one is filter logic and the other is case when logic.
They are the same 4 conditions. And the second one doesn't work because of the common table error:
"No common table could be found. The tables ["o_celonis_SalesOrder"] and ["o_custom_CustomerAccountItem"] are connected, but have no common table. This means that they do not have a direct (or indirect) 1:N or N:1 relationship. Join path: [o_celonis_SalesOrder]N <-- 1![o_celonis_Customer]!1 --> N[o_custom_CustomerAccountItem]"
 

Be the first to reply!

Reply