Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get total value in table diagram instead of a total null-value!

Hello Community,

I have a problem with one of my tables and i can't seem to find the solution yet.

Below you can see my table with the total row at the end. Instead of "1751/2000 = 87,55%" it shows me a NULL-Value. How can I fix it? Thanks in advance.

Problem.JPG

This is my setting for the last column (sorry its in german 😞

problem2.JPG

1 Solution

Accepted Solutions
rubenmarin

If you have only one value per project for "worked (h)" and "to work (h)" this expression can work:

[worked (h)]/[to work (h)]

But this will fail in totals row, as it has more than one value for each field.

This expression can work with only one value and for a group of values:

Sum([worked (h)])/Sum([to work (h)])

View solution in original post

7 Replies
martinpohl
Partner - Master
Partner - Master

what is the declaration in the third expression?

Regards

marcus_sommer

Maybe you used this as expression: alt([worked (h)] /  [to work (h)], 0) to catch possible errors like occuring by division through 0.

- Marcus

rubenmarin

If you have only one value per project for "worked (h)" and "to work (h)" this expression can work:

[worked (h)]/[to work (h)]

But this will fail in totals row, as it has more than one value for each field.

This expression can work with only one value and for a group of values:

Sum([worked (h)])/Sum([to work (h)])

Not applicable
Author

The declaration is [(worked (h))/(to work (h))]

Not applicable
Author

Yes thanks you are right i just used Sum([worked (h)])/([to work (h)]) now i use Sum([worked (h)])/Sum(Distinct [to work (h)]). But now i have a different problem that the total row shows me a wrong percentage (see below). I think maybe its because some projects has the same to work hours so the distinct function calculates something wrong or the NULL-values are doing something crazy.

Problem.JPG

rubenmarin

Yes, the distinct in that value can cause issues with the results. Why you need to use distinct?

Maybe is beacuse for each project you have many rows with the same value and only need one, in this case maybe this can work:

Sum([worked (h)])/Sum(Aggr([to work (h)], Projects_FieldName))

Not applicable
Author

Thanks Ruben! It works now !!