12 Replies Latest reply: Jul 11, 2018 11:34 AM by Elizabeth Viso

# Calculating Percentages

Hello,

I am trying to get the percentages of pending items.

so I have an inventory count of 36, 0 pending so it'a 0% pending, but for some reason, I'm not always getting the right totals. This is what I have tried:

=Count({1}DISTINCT BarcodeI) / (Count({1}DISTINCT BarcodeI)) - (Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode) )/100

I must be missing something in my expression.

Thank you!

• ###### Re: Calculating Percentages

What are you getting right now?

• ###### Re: Calculating Percentages

Hey Sunny,

So right now for items that are inventory count 356 and 0 are pending I get -256%, but if it's inventory count 194 and pending 188 I get the correct answer of % Pending 94%.

• ###### Re: Calculating Percentages

Seems like problem with parenthesis...

=Count({1}DISTINCT BarcodeI)/(Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode))/100

• ###### Re: Calculating Percentages

Right that makes sense, but still, the totals aren't all correct:

• ###### Re: Calculating Percentages

Sorry, but which totals are we talking about? I am a little confused

• ###### Re: Calculating Percentages

I'm sorry!

So for the line item Exit light which is:

Inventory = 356 and Pending = 0 the % Pending is - which is correct

But for the line item Fire Extinguisher:

Inventory= 173 and Pending = 1, the % Pending is 173% which is incorrect

• ###### Re: Calculating Percentages

Can you share the expressions for Pending and Inventory?

• ###### Re: Calculating Percentages

Inventory:

=Count({1}DISTINCT BarcodeI)

Pending:

=Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode)

• ###### Re: Calculating Percentages

So what you really want is this

=(Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode))/Count({1}DISTINCT BarcodeI) * 100

• ###### Re: Calculating Percentages

Hey SUnny!

Yes that works but I had to add /100 to the end:

=(Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode))/Count({1}DISTINCT BarcodeI) * 100/100

• ###### Re: Calculating Percentages

Oh, then why don't you just use this?

=(Count({1}DISTINCT BarcodeI) - Count(DISTINCT{<Pass= {'YES'}, Barcode>} Barcode))/Count({1}DISTINCT BarcodeI)

• ###### Re: Calculating Percentages

Sunny, Perfect!!!