Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

using the If Statement in dimensions to pull data for a specific type

in my charts properties, trying to get a count of all orders that have an order type of 'O' and the back order number of '000' - currently just workinh on getting only the types of 'O' but its not working.

what am I missing in this expression.

= if(VCOHead_ordertype='O',count(VCOHead_ordertype))

my dimensions - I selected Order source and order type.

if anyone has examples of if statements that work - I would be willing to do more debugging. thank you



6 Replies
Not applicable
Author

I would suggest changing the order of the IF/COUNT to the following...

=COUNT(IF(VCOHead_ordertype='O',VCOHead_ordertype))

Not applicable
Author

the count is the same so I am assume its pulling in the order types that are quotes which I do not want.

pover
Luminary Alumni
Luminary Alumni

You can also use set analysis in the following way

COUNT({$<VCOHead_ordertype -= {'O'}>} VCOHead_ordertype)

Also, it is more common to count distinct of the ID's of the transactions and not a count of one of its description field like order type.

COUNT({$<VCOHead_ordertype -= {'O'}>} distinct OrderId)



Regards.

johnw
Champion III
Champion III

Rob's expression is a solution for your problem as I understood it, so apparently neither of us understand your problem. Can you post an example?

Not applicable
Author

COUNT({$<VCOHead_ordertype = {'O'}>} distinct VCOHead_ordernu)

this piece of code is working - now I need to add another check point. along with the ordertype must equal the letter 'O' the field called DEL must be equal to 'A' and the back order number must equal to '000' how would you add this to the formula?

johnw
Champion III
Champion III

COUNT({<VCOHead_ordertype={'O'},DEL={'A'},BackOrderNumber={'000'}>} distinct VCOHead_ordernu)