Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating Days of Supply and Monthly Average by Inventory Item

I have a variable called "Days of Supply" this will show me the number of days based on the qty on hand we have. My problem right now is that It is showing the total days of supply and I am wanting it to show me the days of supply based on each individual inventory item. Is there something I'm missing to make this happen?

I also am having the same issue with the monthly average. My monthly average is showing me the total monthly average of all products. What I am wanting to see is:

     For each tran Period I have selected it will total up my Qty by Month column for that item and give me the monthly average based on that item and the tran periods that are selected.

Ex4.PNG

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

Here it is again. Should be 31MB. I can see that the last upload was only 9MB so something must have gone wrong.

View solution in original post

14 Replies
JonnyPoole
Employee
Employee

What does the variable definition/formula look like  ?

You may want to remove any preceding '=' so that the text of the variables formula is evaluating dynamically within the context of its use.

Put another way:

if your variable is vSales with a formula of:

=sum(Sales)

It will calculate the total sales of the user selections

but if its:

sum(Sales)

and you add to a chart expression which has customer as a dimension and invoke it like this
$(vSales)

the 'sum(Sales)' will be evaluated for each customer.

Not applicable
Author

My variable for DaysOfSupply:  =Num(Sum (QtyOnHand)/(MonthlyAvg)*30)

Variable for MonthlyAvg:  =Num((TranQty)/(GetSelectedCount(TranPeriodID)))*-1

In the variable when I take out the '=' i come up with a blank within the selected inventory item. and if nothing is selected there are also blank spaces for the days of supply and monthly average.

JonnyPoole
Employee
Employee

Ok, after removing the '=' did you reference the variable in the expression with dollar sign expansion ?

ie:   $(variablename)

If you did i would like to play with the sample myself ... can you post the QVW ?

Not applicable
Author

I just did add the $ expression and still nothing. I'm not sure how to post the QVW for you though?

JonnyPoole
Employee
Employee

Add a new reply to the original post . Then you will see 'Use Advanced editor' in the top right of the post. Click that and you can upload attachments.

Not applicable
Author

I don't think I have that ability to add an attachment. I don't see "Use Advanced Editor" when I go to reply to the original post.

JonnyPoole
Employee
Employee

You have to show the full thread or from your email 'view full discussion'.

Then when you hit reply... it will show as below.

Untitled.png

Not applicable
Author

Attached is the qvw I'm working on.

Not applicable
Author

It is under the tab "Inventory Summary"