Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
waleeed_mahmood
Creator
Creator

Sum Distinct Values in Table Total

Hello,

I have a question that i cant seem to solve.

I have the following table:

Region CoverageSales EmployeeTargets
Eastuser11,350,000
Eastuser21,350,000
Eastuser31,350,000
Eastuser41,350,000
Total 5,400,000

 

Since, the region is the same and the targets are the same, can we have the total to be 1,350,000 since all targets in the regions are the same?

Thank you in advance.

Waleed

23 Replies
waleeed_mahmood
Creator
Creator
Author

Hi Sunny,

While your expression works for example provided by Thiago, it doesn't work for my Target numbers. My Targets are attached to a Master Calendar so they can be filtered for months and show YTD numbers and when we do Distinct Targets it uses the distinct values from all those daily targets. Would you happen to have an expression where the distinction is applied after the summation of targets.

Please let me know if this makes sense or i can try to word it better.

Thank you.

sunny_talwar

May be try this

If([Region Coverage] = 'East',
    Aggr(NODISTINCT Sum(DISTINCT Aggr(Sum(Target), [Region Coverage], [User])), [Region Coverage])),
    Sum(Target)
)
waleeed_mahmood
Creator
Creator
Author

Hi Sunny,

I was able to get it to work by taking out the first aggr.

Thank you @Thiago_Justen_  and @sunny_talwar  for all your help.

Thanks

sunny_talwar

Awesome, I am glad it finally worked.