Qlik Community

Qlik Sense Data Connectivity

Discussion board where members can learn more about Qlik Sense Data Connectivity.

Highlighted
KAnderson_5
New 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.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Issue using nodistinct

You may not need an Aggr() here. How about this?

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
zzyjordan
Contributor II

Re: Issue using nodistinct

Hi,
Can you provide some sample data similar to your data structure?
ZZ
Partner
Partner

Re: Issue using nodistinct

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
MVP
MVP

Re: Issue using nodistinct

You may not need an Aggr() here. How about this?

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
KAnderson_5
New Contributor

Re: Issue using nodistinct

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

Thanks, Jontydkpi!