Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ramyasaiqv
Creator II
Creator II

Help need with expression

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

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

=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
,'-') 

View solution in original post

9 Replies
Anil_Babu_Samineni

May be this?

Count({<Type = {'BCT', 'ECT'}, Status = {'Open','Accepted'}>} Order)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
antoniotiman
Master III
Master III

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
Partner - Champion III
Partner - Champion III

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)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
antoniotiman
Master III
Master III

=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
Creator
Creator

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
Creator II
Creator II
Author

Thank you Antonio.

ramyasaiqv
Creator II
Creator II
Author

Thank you for the response Anil.

ramyasaiqv
Creator II
Creator II
Author

Thank you for the response Jonathan.

ramyasaiqv
Creator II
Creator II
Author

Thank you for the response hari krishna.