Hi all,
In a KPI chart, the script that i wrote for "monthly inventory day" worked perfectly, also the rolling one worked truely.
However, when i put that measure into a bar or combo chart, it could not calculate the inventory days periodically.
This is the written script for Monthly Inv Day; I can reach the correct result as i said in the "KPI" chart tool when i choose a period,
but when i want to see the trend of Monthly Inventory day in a line or bar chart i could not find the results for each period.
(((sum({<[Period]={">=$(vPrePeriod) <=$(vMaxPeriod)"}>}[Stock Tier 1 TL DIO])+
Sum({<[Period]={">=$(vPrePeriod) <=$(vMaxPeriod)"}>}[Stock Tier 2 TL DIO])+
Sum({<[Period]={">=$(vPrePeriod) <=$(vMaxPeriod)"}>}[Stock Transit TL DIO]))/2)/
(sum({<[Period]={"=$(vMaxPeriod)"}>}[Sales Tier 1 TL DIO])+
sum({<[Period]={"=$(vMaxPeriod)"}>}[Sales Tier 2 TL DIO])))*30
In a simple way that i need to calculate; lets assume we are at the end of M month
a= ınventory M
b= Inventory(M-1) Monthly Inventory Days= ((a+b)/2/c)*30
c=Sales M
Makedate(left([Period],4),right(left([Period],6),2),1) as Date, the date definition in the script side,
Variables for the periods,
vMaxPeriod=Date(Max(Date),'YYYYMM')
vPrePeriod=Date(Addmonths(Max(Date),-1),'YYYYMM')