Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
@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 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))
@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)
@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.
@marcvw So what I suggest is wrong or not working? Could you please elaborate?
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?
It's project amount as you mentioned in your post?