Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count of Month whose Adherence <=70 %

Hi,

I have to write an expression to find a count of months whose adherence is below 70% and also we need to calculate it if we select one or more months at the same time. Adherence is calculated by a specific expression.

Adherence:

count( DISTINCT   Bill_PKInvoiceNo & Bill_tractorsrlno))-count( DISTINCT  Sales_InvoiceNo & Sales_tractorsrlno))
/
((
sum(aggr(sum( distinct   Billing),DealerCode,Category,Month)))+sum(aggr(sum( distinct  Billing_Yuvraj),DealerCode,Category,Month))))

If we select 2 months at a time, Thera can be situation wher for 1month it is above 70% and for 1 month it is below 70%..

By giving below Expr, I am getting value as 2 where as it should be 1.

if ( (((count( DISTINCT   Bill_PKInvoiceNo & Bill_tractorsrlno))-count( DISTINCT  Sales_InvoiceNo & Sales_tractorsrlno))
/
((
sum(aggr(sum( distinct   Billing),DealerCode,Category,Month)))+sum(aggr(sum( distinct  Billing_Yuvraj),DealerCode,Category,Month)))) <=0 .7,
count(distinct  Month), Null())

Kindly suggest as I need to get value as 1.

Regards

Rajeshree

0 Replies