Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation of DISTINCT COUNT in MTD

I need to calculate, day by day,  the MTD of  the quantities and the distinct customers.

In the table, in the first columns, the data are daily, the others are calculated from the MTD.

Immagine.jpg

For the calculation of the amount of quantities, no problem, I use the following expression:

if(rowno()<=vDAYmax, sum(if([REFERENCE YEAR]=vYEARmax ,QUANTITY)),'')

Turning to the calculation of mtd distinct customer, with the following expression, there is no result.

if(rowno()<=vDAYmax,
COUNT(DISTINCT
(
if([REFERENCE YEAR]=vYEARmax,COD_ID)))
,'')

Why??

Can anyone help me ??

Thanks

Fulvio

from Italy

0 Replies