Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
marcvw
Partner - Contributor III
Partner - Contributor III

Expression for calculate % inside or outside

Good Day All, 

I have the attached information. 

I would like to calculate the % inside and %outside. In addition, in case the amount of projects change, the total line items need to change as well What would be the correct expression to perform this in Qlik Sense? 

The field 'status' is a text field.

Project status % inside % outside
1 inside 14%  
2 inside 14%  
3 inside 14%  
4 outside   14%
5 outside   14%
6 outside   14%
7 outside   14%
    43% 57%

 

Appreciate your support in here. 

Labels (3)
1 Solution

Accepted Solutions
Kushal_Chawda

@marcvw  If your Inside/Outside project level % value is from total proportion of all inside and outside then try below

Inside %

Sum({<Status={'Inside'}>}Value)/
sum(total Value)

Outside %

Sum({<Status={'Outside'}>}Value)/
sum(total Value)

View solution in original post

6 Replies
Kushal_Chawda

@marcvw  If I understood it correctly, create a table with dimension Project & Status and below measures

Inside %

=if(Dimensionality()=2,
Sum(Amount)/
sum(total <Status>{<Status={'Inside'}>}Amount),

Sum({<Status={'Inside'}>}Amount)/
sum(totalAmount))

 

Outside %

=if(Dimensionality()=2,
Sum(Amount)/
sum(total <Status>{<Status={'Outside'}>}Amount),

Sum({<Status={'Outside'}>}Amount)/
sum(totalAmount))

Kushal_Chawda

@marcvw  If your Inside/Outside project level % value is from total proportion of all inside and outside then try below

Inside %

Sum({<Status={'Inside'}>}Value)/
sum(total Value)

Outside %

Sum({<Status={'Outside'}>}Value)/
sum(total Value)

marcvw
Partner - Contributor III
Partner - Contributor III
Author

@Kushal_Chawda , thank you for your response in here. 

The table contains the field 'project' and 'status'. The field '%inside' and '%outside' needs to be calculated. Hope this clarifies. 

Kushal_Chawda

@marcvw  So what I suggest is wrong or not working? Could you please elaborate?

marcvw
Partner - Contributor III
Partner - Contributor III
Author

in the statement

Inside %

Sum({<Status={'Inside'}>}Value)/
sum(total Value)

 

you are referring to a field 'value'. In my particular example, which field do i need to utilize? 

Kushal_Chawda

It's project amount as you mentioned in your post?