Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
I'm trying to write an if statement to only show Quarantined Inventory. Wanting to separate it from the total inventory count. I'm either getting an 0 or a number higher than my current inventory count. Below is my current if statement and how I populate inventory. Any and all help will be most welcomed.
If( [InvHistory Transaction Type] = 'Quarantined' , $(InventoryQuantity) , 0)
sum({$< [Inventory Date] = {"<=$(=date(max(Date)))"}, 
 Year={*},
 Period={*},
 Date={*},
 Month={*},
 [Calendar Year] = {*},
 [Inventory Status Code] -= {1},
 [LinkId]={"INVHSTD"}
 >}
 [InvHistory Transaction Quantity]) 
 
					
				
		
 johnw
		
			johnw
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Perhaps just add this to your set expression?
[InvHistory Transaction Type]={'Quarantined'},
 
					
				
		
 Oleg_Troyansky
		
			Oleg_Troyansky
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Just to clarify John's response - you can't ask this question outside of your sum(). Instead, you should either ask it inside the SUM(), or better off, add it as another filter in your set analysis condition.
cheers,
Oleg Troyansky
Learn advanced Qlik techniques in my book QlikView your Business
 
					
				
		
Thank you guys for helping. This is how I solved it. Used [Inventory Quarantined] ={'Quarantined'}, .
sum({$< [Inventory Date] = {"<=$(=date(max(Date)))"}, 
 Year={*},
 Period={*},
 Date={*},
 Month={*},
 [Calendar Year] = {*},
 [Inventory Status Code] -= {1},
 [Inventory Quarantined] ={'Quarantined'},
 [LinkId]={"INVHSTD"}
 >}
 [InvHistory Transaction Quantity])  
