Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewlau120
Contributor
Contributor

Do a Cost Allocation in set Analysis

Dear all,

 

I would like to exclude the others category in the screenshot and  evenly allocated its value into other categories, for example: 32000 should divide 5 and allocate into other categories. Would anyone feel free to help?

 

its set expression:Sum(Amount)-sum( {<NewType={"Others"}>}Amount) 

 

Screenshot 2019-03-14 at 5.33.40 PM.png

2 Replies
amrinders
Partner - Contributor II
Partner - Contributor II

Hi Matthew,

 

Create a variable in which you have to calculate sum of amount for only Others and divide it by distinct  count of New Type Field (Excluding Others). Then in your pivot/table you have to exclude 'Others' in your Dimension and in Measure you can write Sum({<NewType-={'Others'}>}Amount)+ $(vOthers).

 

Regards,

Amrinder

marcus_sommer

Maybe something like this might be helpful in your case:

sum({<NewType -= {'Others'}>} Amount) +
   (sum({1<NewType = {'Others'}>} Amount) *
        (sum({<NewType -= {'Others'}>} Amount) / sum({<NewType -= {'Others'}>} TOTAL Amount)))

- Marcus