Skip to main content

Hello,

 

Could you please explain how to calculate Total% (Contribution) in a list view using an expression?

 

List View is the following:

Product    Q1 Q2   RowTotal   Total%

Apple       15  15        30              ?  (30 100 = 0.3)

Mango     15   35       50              ?

Limon       10  10        20              ?

 

Total sum: 100

 

RowTotal is the expression and Sum is the list aggr expression. Don't know how to calculate  Total% column which is contribution.

 

With my best regards,

Maria

Hello Maria,

There are a couple things we can do.
#1. We can set up a Style on that column in the List View to show as a percentage. See the following Documentation.
http://help.k2.com/onlinehelp/K2Cloud/UserGuide/Update_7/default.htm#Create/K2Designer/Styles/Styles.htm

#2. We can use an expression to multiply by .1 on the List View Column to return a percentage.

These are probably the easiest ways to accomplish this.
Dear MTMTNT,

I don't need to do any format conversion. The ExpectedTotal% column was filled down as an example of expected result.
I need to calculate this column ( need an expression which will show contribution) Could you please tell me how to do it?

Regards,
Maria

Good Day MariaDmitrieva


 


By the looks of your requirement it seems that you want to know how to add another expresison into the ExpectedTotal% column which should calculate the total percentage that each rows RowTotal has over the Total Sum


 


To do that you can simply call the existing RowTotal expession inside of the ExpectedTotal%'s expression. See the configuration steps in the following screenshot.



Note: After adding the expressions as per above you notice tha the ExpectedTotal% will be in a decimal value therefore you will need to set the Percentage styling onto the ExpectedTotal% column to display the decimal as percentage. See image below on how to set the decimal value to percentage.



 


Result Preview:



 


Should you feel that this post is of use and or an accurate solution to the raised question, I kindly encourage you to mark it as such using the 'Mark as Solution', 'Kudo' andor ‘Me Too’ options.


 


Kind Regards


Raymond


 


Reply