Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IF Statement

Hi,

I am creating a document where I look at the cover of stock in the warehouse. I want to created a figure based on the stock we currently have, plus the stock on the way, divided by the week before sales.

What I am trying to say is If On Order = 0 then Free Stock/Sum, otherwise ([On Order]+Free_stock)/Sum (if (InWeek (SI_Date, Today(), -1), [Quantity])) .

Any help is much appreciated.

Regards

David

6 Replies
avinashelite

share the mock up data ..will help you

Anil_Babu_Samineni

May be this?

If([On Order] = 0, [Free Stock]/Sum, ([On Order]/Free_stock)/Sum(If(InWeek(SI_Date, Today(), -1), Quantity)))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
its_anandrjs

Can you share any sample data or what is mean by On Order = 0 kindly elaborate.

Anonymous
Not applicable
Author

My formula looks like this..

([on Order]+[Free_stock])/Sum (if (InWeek (SI_Date, Today(), -1), [Quantity]))

So, for instance in the attached screenshot, 6712 in stock + 5520 on order, LW sales were 1776 meaning total cover of 6.9 (6.88 without rounding)img.png

Anil_Babu_Samineni

Perhaps this?

Round((Stock+[On Order])/LW, 0.01)

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
its_anandrjs

You need 6.88 or 6.9