Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

1 is to Many Chart Issue when using Distinct on expression

Hi Qv Community,

I used an aggregation and distinct on an variable which give me the right figures I wanted but when I plot it on the table as an expression

with the document numbers, it shows a misleading result. please see result below.

111.png

The Correct PR Unit figure is 1500, I want my output to be like the one below111.png

Expression is : Sum(aggr(Sum(Distinct [PR Unit]), [PR No], [Item Number]))

Thanks!

Regards,

Charles

6 Replies
arulsettu
Master III
Master III

what are the dimensions using in your chart?

try this

aggr(Sum(Distinct [PR Unit]), [PR No], [PO No])

tresesco
MVP
MVP

Try:

Sum(aggr(NoDistinct Sum(Distinct [PR Unit]), [PR No], [Item Number]))

jonathandienst
Partner - Champion III
Partner - Champion III

Perhaps you need something like:

    Sum(Distinct TOTAL [PR No])

    or

    Sum(Distinct TOTAL<[PO No]> [PR No])


If you need the Distinct to apply at a lower level, then you can use Aggr(), but you need to include ALL the chart dimensions as dimensions for your Aggr(), in addition to any dimensions the expression requires. But this can affect the result for distinct if you use too many dimensions. You might need something like this to fix that:


    Sum(TOTAL<[PR No]> Aggr(Sum(Distinct [PR Unit]), [PR No], [Item Number], [PO No]))


(assuming the values in the PR Unit column are totals for a PR No)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anil_Babu_Samineni

Would you be able to provide application.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

I use dynamic dimensions so a lot of field can be added as dimension on my chart

Not applicable
Author

the red rows indicates that the Document is deleted, can I have this output instead?

111.png