Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
siva_boggarapu
Creator II
Creator II

How to tune below expressions?

Hi,

I have table with the below expressions. The below expressions are giving me bad performance while I am doing in selection

Is there any better way we can modify the below table expressions?

Unique Leads per Center:

avg(aggr(count(distinct CallerNumber), ShopNumber))

Lead Conversion %:

count(distinct IF(InvoiceDateDT - CallDateDT >= 0 and InvoiceDateDT - CallDateDT <= $(vConversionLimit), CallerNumber)) / count(distinct CallerNumber)


Conversion ARO:

avg(

aggr(

    max(

        IF(

            InvoiceDateDT - CallDateDT >= 0 and InvoiceDateDT - CallDateDT <= $(vConversionLimit),

                NetAmount

            )

        )

    ,InvoiceHeaderId

    )

)

Thanks,

Siva

11 Replies
sasiparupudi1
Master III
Master III

I would say, Make this InvoiceDateDT - CallDateDT as a field in the script

sasiparupudi1
Master III
Master III

Or if you want the change in the frontend only then may be try

=count(distinct {<CallerNumber={'=$(InvoiceDateDT - CallDateDT)<= $(vConversionLimit)'}>}CallerNumber) / count(distinct CallerNumber)