Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
tas_taba1
Contributor III
Contributor III

De-Normalizing a dimension for multiple fields in a straight table

Hello Qlikkers,

I have a dataset like this-datasetdataset

Now, I want to create a straight table in Qlik Sense that will have Race, CinemaStratum, CinemaPSU as dimensions and sum(UtilityWt) as measure. I want the straight table to look like this-

expectedexpected

But I want all the CinemaStratum and CinemaPSU to be included for each of the races. Even if some of the cinemaStratum/cinemaPSU does not have utilityWt, I want to be inserted in that row for the measure i.e. I want to have 10 rows(total no. of PSUs) for each of the races. All I have is the table below which does not include the missing stratums/PSUs.

currentcurrent 

I am at my wits' end about how to proceed further. I have created an island table but with my little experience of data modeling I can't really connect it to the fact table and compare to include all the values. I don't even know if that's a feasible solution. I would appreciate any help or suggestions.I am really looking forward to hearing from all the experts here! I am attaching my dataset and application(please refer to sheet2) here for reference.

Thank you.

Labels (4)
10 Replies
tas_taba1
Contributor III
Contributor III
Author

@sunny_talwar , no that's not giving the correct output-

wrong_resultwrong_result

I tried this expression earlier which was giving correct results for two of the rows-

'=if((Dimensionality()=1),
(Sqrt(Sum( {1} Aggr(
((sqr(Sum(UtilityWt) - Sum(Total <CinemaStratum,Gender> UtilityWt)/Count(DISTINCT ALL <CinemaStratum> CinemaPSU))) * (Count(DISTINCT ALL <CinemaStratum> CinemaPSU)/(Count(DISTINCT ALL <CinemaStratum> CinemaPSU)-1)))
, Gender, CinemaStratum, CinemaPSU)))),
Sqrt(Sum( {<Gender>} {1} Aggr(
((sqr(Sum(UtilityWt) - Sum(Total <CinemaStratum,Race,Gender> UtilityWt)/Count(DISTINCT ALL <CinemaStratum> CinemaPSU))) * (Count(DISTINCT ALL <CinemaStratum> CinemaPSU)/(Count(DISTINCT ALL <CinemaStratum> CinemaPSU)-1)))
, Race, Gender, CinemaStratum, CinemaPSU)))
)'