Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 ramyasaiqv
		
			ramyasaiqv
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi All,
I’m trying to count the number of orders which have Type= ‘BCT’ and Status=’Accepted’ (no ECT status at all) and Type=’ECT’ and Status=’Open’ or ‘-‘.
Please can someone help me in writing the expression? Attached sample qvw and excel for reference.
Expected Result:
Count 3(BUS, DESC and PTZ)
Thanks,
Ramya
 antoniotiman
		
			antoniotiman
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		=Count({<Order=P({<Type={'BCT'},Status={Accepted}>})*
 P({<Type={'ECT'},Status={Open}>+<Order={"=Count(Order) = 1"},Type={'BCT'},Status={Accepted}>})>} DISTINCT Order)
 &Chr(10)&
 Concat({<Order=P({<Type={'BCT'},Status={Accepted}>})*
 P({<Type={'ECT'},Status={Open}>+<Order={"=Count(Order) = 1"},Type={'BCT'},Status={Accepted}>})>} DISTINCT Order,'-')  

May be this?
Count({<Type = {'BCT', 'ECT'}, Status = {'Open','Accepted'}>} Order)
 antoniotiman
		
			antoniotiman
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
try this
=Count({<Order=P({<Type={'BCT'},Status={Accepted}>})*
 P({<Type={'ECT'},Status={Open}>+<Order={"=Count(Order) = 1"},Type={'BCT'},Status={Accepted}>})>} DISTINCT Order) 
Regards,
Antonio
 
					
				
		
 jonathandienst
		
			jonathandienst
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Like this
=Count({<Type = {'BCT'}, Status = {'Accepted'}> + <Type = {'ECT'}, Status = {'Open'}>} Order)
By '-', you mean null, I assume. Then maybe this:
=Count({<Type = {'BCT'}, Status = {'Accepted'}> + <Type = {'ECT'}, Status = {'Open'}> + <Type = {'ECT'}, Status -= {'*'}>} Order)
(You have no null statuses in your data, so I could not test this)
 antoniotiman
		
			antoniotiman
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		=Count({<Order=P({<Type={'BCT'},Status={Accepted}>})*
 P({<Type={'ECT'},Status={Open}>+<Order={"=Count(Order) = 1"},Type={'BCT'},Status={Accepted}>})>} DISTINCT Order)
 &Chr(10)&
 Concat({<Order=P({<Type={'BCT'},Status={Accepted}>})*
 P({<Type={'ECT'},Status={Open}>+<Order={"=Count(Order) = 1"},Type={'BCT'},Status={Accepted}>})>} DISTINCT Order,'-')  

 hari8088
		
			hari8088
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Try this.
count(if(Order='BUS'or Order='DESC'or Order='PTZ', if(Type='BCT' and Status='Accepted',Order))) +
count(if(Order='BUS'or Order='DESC'or Order='PTZ', if(Type='ECT' and Status='Open',Order)))
 ramyasaiqv
		
			ramyasaiqv
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you Antonio.
 ramyasaiqv
		
			ramyasaiqv
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you for the response Anil.
 ramyasaiqv
		
			ramyasaiqv
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you for the response Jonathan.
 ramyasaiqv
		
			ramyasaiqv
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you for the response hari krishna.
