# Connectivity & Data Prep

cancel
Showing results for
Did you mean:
Contributor

## Issue using nodistinct

I'm trying to get the total sales across all product groups to do a calculation of profit contribution.  For some reason, I'm unable to have consistent returns across all product groups, which will, in turn, throw off the calculation.

The set analysis I'm using:

Sum(Aggr(nodistinct Sum({\$<Type {'Daily'},ProductGroup=,ProductSubGroup=,ProductDetailGroup=>}SalesCY),Store,DateCY))

Photo shows where I'm seeing inconsistencies for column 1Gross Ticket Contribution.  Those items highlighted in red are the correct value for Store #1, remaining items aren't.

Labels (1)
• ### Data Prep

1 Solution

Accepted Solutions
Partner

Sum({\$<Type = {'Daily'}, ProductGroup, ProductSubGroup, ProductDetailGroup>} TOTAL <Store> SalesCY)

or

Sum({\$<Type = {'Daily'}>} TOTAL <Store> SalesCY)

Add other fields to the total qualifier if needed

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
4 Replies
Creator II
Hi,
Can you provide some sample data similar to your data structure?
ZZ
Partner
Hi,
Do you mean all values for store # 1 should be 13439?
I saw that in aggr(), you also group by the DateCY, could you please try to delete this field?
because I'm not sure why you use the DateCY, it seems like that in your table there is not DateCY as a dimension?
Aiolos Zhao
Partner

Sum({\$<Type = {'Daily'}, ProductGroup, ProductSubGroup, ProductDetailGroup>} TOTAL <Store> SalesCY)

or

Sum({\$<Type = {'Daily'}>} TOTAL <Store> SalesCY)

Add other fields to the total qualifier if needed

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

Removing Aggr() and adjusting to the Total <Store> qualifier you detailed worked perfectly!

Thanks, Jontydkpi!