Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
clondono
Creator III
Creator III

Weeks on Inventory Line Chart

Hello community,

I created a straight table to calculate the Inventory AMT, Inventory QTY, Run Rate and Weeks on Inventory (WOI).  I’m getting the desired results on this table.

1.png

My expressions for the table are:

INV AMT:

SUM({$<YYYYQ=, YYYYWK={$(cLastYYYYWK)}>} InvAMT)

INV QTY:

SUM({$<YYYYQ=, YYYYWK={$(cLastYYYYWK)}>} InvQTY)

RUN RATE:

(sum({<YYYYQ=, YYYWK=,TRANSACTION_YYYYWK={">$(cLastWeek_Minus_1_Qtr_YYYYWK)"}>}ResaleQTY)/13)

WOI (AMT):

                         (Sum({<YYYYQ=, YYYYWK={$(cLastYYYYWK)}>})InvAMT) /
               (
sum({<YYYYQ=, YYYYWK=, PROCESS_YYYYWK={">$(cLastWeek_Minus_1_Qtr_YYYYWK)"}>}ResaleAMT)/13)


WOI (QTY):

[Inv Qty] / [Run Rate]

I have a requirement to display a line chart for the WOI measure and it should display results for the last 26 weeks $(cLastWeek_Minus_2_Qtr_YYYYWK) – see image below for sample requirement.   Any ideas on how to achieve this using the same metrics?

2.png

Thanks!

7 Replies
sushil353
Master II
Master II

Hi,

You can create a mastercalendar in your datamodel having Weeks as desired and put that into you dimension.

to create a master calendar you can search community there are many post out there.. Master Calendar Generation Script

HTH

Anil_Babu_Samineni

Try Like This, Field must be there

Week(DateField) as Week,

Expression:

SUM({$<Week = {'$(=WeekStart(Week,-26))'}, YYYYQ=, YYYYWK={$(cLastYYYYWK)}>} InvQTY)

/

sum({<Week = {'$(=WeekStart(Week,-26))'}, YYYYQ=, YYYWK=,TRANSACTION_YYYYWK={">$(cLastWeek_Minus_1_Qtr_YYYYWK)"}>}ResaleQTY)/13

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
clondono
Creator III
Creator III
Author

cbaqir
Specialist II
Specialist II

Does Anil's solution work?

clondono
Creator III
Creator III
Author

No, neither of the solutions recommended work.  We already have a master calendar and a variable for the "week" field, still unable to create the line chart for Weeks on Inventory.

The app is very large in size, I'm trying to create a slim-down version so I can upload to the community.

Thanks,

Carlos

Anil_Babu_Samineni

That is the best approach.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
cbaqir
Specialist II
Specialist II

Sum({<DATE={">=$(=addweeks(weekend(today()),-26))<=$(=addweeks(weekend(today()),0))"}>}InvQTY)

Sub DATE for your date field.