Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Sxbbb
Creator III
Creator III

I want to find 'WorkOrder' that is 'TYPE1' and must be both in 'Wire1' and 'Wire2'.

I have a field 'TYPE' , 'Wire ' , 'Output ' ,'Number', 'WorkOrder'

in field  'TYPE' contains data  'TYPE1' and 'TYPE2'

in field  'Wire' contains data  'Wire1' and 'Wire2'

 

I want to find 'WorkOrder' that is 'TYPE1' and must be both in 'Wire1' and 'Wire2'.

If it's only on 'Wire1', don't use it.   If it's only in 'Wire 2, don't use

Must be used as 'WorkOrder' for 'TYPE1' and must contain both 'Wire1' and 'Wire2'.

 

Then it takes the derived 'WorkOrder' to get the value. Output*Number using the code : Sum(Aggr((Output*Number),Part,DATE,WorkOrderNo)

 

 

2 Replies
edwin
Master II
Master II

if the condition never changes (always look for Wire1 and Wire2), i would add a flag in your load script to identify these work orders and use that flag in my set analysis.  but if the condition changes (maybe you want a different wire combination, or the data set is filtered and for some date, the two wires can ecome just one wire...) then you cant use this approach.

i would suggest the simplest solution:


if(Type='Type1' and count(distinct {<Wire={'Wire1','Wire2'}>}Wire)=2,Sum(Aggr((Output*Number),Part,DATE,WorkOrderNo))

the key piece is testing the count of wires where you only count wires 1 and 2 and since you are using QLikView, set your chart to exclude NULLs.   this will obviously not work for Qlik Sense

edwin
Master II
Master II

if you want to explore further try this:

sum({<Type={'Type1'}, WorkOrder=p({<Wire={'Wire1'}>*<Wire={'Wire2'}>}WorkOrder)>}Output*Number)