I have created 2 LAC calculated fields,
d_bucket:
count({outb_final_quantity_requested},[{prod_product_id},{site_site_id},{order_date}])/
distinct_count({LAG String},[{prod_product_id},{site_site_id},{order_date}])
d_period:
dateDiff(min({order_date}),max({order_date}),"DD")
Then did some calculations on fields to generate average demand and categorize it into bins
ADI:
{d_bucket}/{d_period}
ADI bins:
ifelse(
{ADI}>0 AND {ADI}<=5, '0-5 days',
{ADI}>5 AND {ADI}<=10, '5-10 days',
{ADI}>10 AND {ADI}<=15, '10-15 days',
{ADI}>15 AND {ADI}<=20, '15-20 days',
'>20 days'
)
Now, when i put ADI bin to the visual in x axis, i get lac calculation on visual error.
I believe this is because of the LAC fields i generated.
Is there a way to generate same result for d_bucket by using LAC-W calculation?
(Note: the same result for d_bucket is done in sql by giving the following query:
select count(*) as d_bucket,p_id from
(select count(*),day(order_date),p_id
from order_line
group by day(order_date),month(order_date),year(order_date),p_id)
group by p_id;
Hope this helps)