cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

How to calculate zero portion in %

Thomas1
Level V

What is the best way to create on formula column, which shows the portion in percent of values = 0 (Zero portion)?

In case the value column is empty, no portion value should be display in the formula column.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User


Re: How to calculate zero portion in %

I think this might do what you want

If( Is Missing( :Value ) == 0,
	Col Sum( If( :Value == 0, 1, :Value > 0, 0, . ), :SubGroup ) / Col Number( :Value, :SubGroup ),
)
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User


Re: How to calculate zero portion in %

I am not exactly sure what you are looking for, but if you want to know the portion of the data table that contain zeros, I have included a couple of formulas that will do that

zeroportion.GIF

Jim
Thomas1
Level V


Re: How to calculate zero portion in %

Thanks for your fast response.

I'm looking for formula which shows the portion of the vaule 0 only. Additional if the cell of the source is empty, the cell for the corresponding portion value should be empty.

 

I’m able to achieve this with the formula

 

 

If( Is Missing( :Value ) == 0,
            Col Sum( If( :Value == 0, 1, :Value > 0, 0, . ) ) / Col Number( :Value ),
            .
)

 

 Despite getting the right result, I am wondering whether there is a better way to solve this. In particular with regards to apply this formula to sub groups.

txnelson
Super User


Re: How to calculate zero portion in %

I think this might do what you want

If( Is Missing( :Value ) == 0,
	Col Sum( If( :Value == 0, 1, :Value > 0, 0, . ), :SubGroup ) / Col Number( :Value, :SubGroup ),
)
Jim
Thomas1
Level V


Re: How to calculate zero portion in %

Thanks again for yor fast reply.