Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
jasonrimkus
Contributor II
Contributor II

Grouping Dimensions to New dimension, aggregating from original dimensions

I have a dataset that has a numeric count, the sum(sales) would have to be divided by the numeric count.  There are other dimensions that I'd like to add to the expected result table, but for simplicity, I have parred down the table here.  

Where multi-attribution is 1, that is its own group, everything that isn't one should be grouped together, but need to be divided by its own multi-attribution number.

Raw Data

MA_DescMultiAttributionStoreSales
1:11A600
1:11A400
1:11B300
MultiAttrib2A800
MultiAttrib2A1200
MultiAttrib3B1500
MultiAttrib3B100
MultiAttrib3B300
MultiAttrib3A400

 

Expected Result (the math is in parenthesis)

MA_DescStoreSales/MultiAttrib
1:1A$1000 (1000/1)
1:1B$300 (300/1)
MultiAttribA

$1133.33                         (2000/2 + 400/3) 

MultiAttribB$633.33                   (1900/3)

 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum(Aggr(Sum(Sales)/MultiAttribution, MA_Desc, Store))

View solution in original post

3 Replies
sunny_talwar

Try this

Sum(Aggr(Sum(Sales)/MultiAttribution, MA_Desc, Store))
lironbaram
Partner - Master III
Partner - Master III

hi

use this expression

sum(aggr(sum(Sales)/MultiAttribution,MultiAttribution,Store,MA_Desc))

jasonrimkus
Contributor II
Contributor II
Author

Thanks!  I had the divisor field on the outside...