Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight table expression total to sum of rows issue

below straight table show different values for the total by expression to total by sum of rows,

69+644=713 but shows as 711.

I thought it was blanks or duplicate records thats coming in but i have already looking for a distinct count.

This issue solves by using aggr by targeted filed but i would like to know if i am missing something in order to get the correct count?

Capture.JPG

Thanks.

9 Replies
swuehl
MVP
MVP

and your expression looks like?

Not applicable
Author

Count (distinct Code) is the expression

swuehl
MVP
MVP

I would interprete the result this way:

Some Code values are related to Targeted value 'Y' as well as to value 'N'.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

@swuehl is correct on the reasoning for the values not adding up.

What the aggr is doing is working out the total that are Y and then the total that is N, and then putting them together.  This means that the two that are in both are accounted for in both.

You can get the same result by changing the Total method (on the Expressions tab), from Expression Total, to Sum Of Rows.  This will always total the values underneath, rather than calculating again.  More often than not the Expression Total is the most useful figure though.

If each value should only be one or the other Targeted value you may want to check back to your source data.

To find the dupes, create a table with the Code as a dimension and the following expression:

=if(Count(DISTINCT Targeted) > 1, 1, 0)

Hope that helps,

Steve

Not applicable
Author

I gave it a try to check for the dupes with the way Steve has mentioned but it doesn't help to figure the dupes?

Does this mean there is no dupes?

If there are dupes whats the best of finding it in QlikView?

Capture.JPG

ToniKautto
Employee
Employee

Your screenshot shows the Num() function, so I guess you are not only doing a Count(DISTINCT) here. Could you please attach a sample QVW file so that your data, dimension and expression can be seen in its full context?

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

It looks like you have no Codes that are off both types, but you may have

Null values associated with both types. It seems odd that Count would pick

those up though.

Suggest adding a code list box, selecting all values and see what your

result is.

If it is null Codes you can remove them with set analysis:

Count ({<Code={"*"}>} Distinct Code)

Hoe that helps.

Steve

jagan
Luminary Alumni
Luminary Alumni

Hi,

In straight table try like this

Properties -> Expression -> Select Expression -> Select Total Mode as Sum (of Rows)

This will show the total by summing up the value in each row.

Hope this helps you.

Regards,

Jagan.

ankitaag
Partner - Creator III
Partner - Creator III

Hi,

Can you provide the data from which these values are coming