Calculate Percentage in VC

Chris_Jeal
Participant V

Hi Community,

I have two columns:

Physical column: Total = 20,000
Virtual column: Total Declared = 5,145

I would like to create a VC with the percentage formula which at the minute Iโ€™m lead to believe is:

([Total Declared]/[Total])*100

although this formula produces a 0.00% where really I think it should be 25.7%.

Any ideas would be greatly appreciated.

Thanks in advance,
Chris.

0 6 2,294
6 REPLIES 6

LeventK
Participant V

@Chris_Jeal
([Total Declared]*100.00)/[Total]
should do the trick

Spot on, thanks @LeventK

Youโ€™re very welcome

if you define the column as type = Percent, do you need to divide/multiply by 100 at all?

It seems that you do, just tried without the * and the calculation didnโ€™t work, just left me with 0.00.

Chris.

There seems to be a bug here.

You should be able to use a Percent column and perform the raw division - โ€œA / Bโ€. It will then automatically convert the value to Percent and display it with the โ€œ%โ€.

In fact, when adding a new row or Editing a row, the VC column will calculate the value correctly.

After a sync is performed, the value reverts to zero. See images below.

Is this a known issue??

Immediately after Editing the row_____________Value goes to zero after a Sync

2X_e_e478339836d217ba1c3107061870a99d10284a15.png

2X_a_a4aa9f6cf03e1fd0335a287f523f4101f76134fb.png


This issue stems from division of two Number type columns. There are two ways to still use the Percent type VC column and make the correct Percent value โ€œstickโ€:

  1. Re-dfine the number columns as Decimal with ZERO decimal digits. The values are treated like Numbers but are in fact Decimals.

  2. Force the result in the VC to be decimal by mult one of them by โ€œ1.0โ€ - "A * 1.0 / B"

EDIT: This exact issue was asked back in July but was not reported as a bug. Iโ€™ll open one for it.

Bug opened:

Top Labels in this Space