Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiply Occurring Fields

Hello Community,

I am running into an issue where the table I want to join to the "Fact table" has multiply occuring fields (acct #s in this case). This is causeing my calculations to be skewed (Sum (LOS), Sum(Total Charges) etc.) So for example my two tables would looks like this:

FACT_TABLE:

Acct #Principal DiagnosisCasesLength of StayTotal Charges
Z1DX515 days$10000
Z2DX7110 days$20000
Z3DX4120 days$40000
Z4DX312 days$5000

SEC_DIAG:

Acct #Secondary Diagnosis
Z1DX15
Z1DX23
Z1DX6
Z2DX2
Z2DX9

I would have orginally liked to do a join so that for Acct# Z1 you can see the Principal Diagnosis and the 3 related Secondary Diagnosis while Cases (1), LOS (5 days), and Total Charges ($10000) remain static. Obviously with a join I am going to see all these fields populated 3 times and therefore my Cases, LOS, and Total Charges become skewed.

Is there a work around for this?

Any help or suggestions is appreciated,

EK

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Check the attached hope it helps

View solution in original post

4 Replies
sushil353
Master II
Master II

Why do u want join here.

Qlikview will automaticaly associate it and when u will select Z1 then u will be able to see the secondary as well...

Not applicable
Author

Right, even without saying join it will connect the two tables in that same fashion (excuse my use of join). it will look like this:

Acct#Principal DiagnosisSecondary DiagnosisCasesLength of StayTotal Charges
Z1DX5DX1515 days$10,000
Z1DX5DX2315 days$10,000
Z1DX5DX615 days$10,000

Then as I enter in my formulas Sum(LOS)=15 days. This is incorrect.

How I would like it to "see" the data is like this:

Acct#Principal DiagnosisSecondary DiagnosisCasesLength of StayTotal Charges
Z1DX5DX1515 days$10,000
DX23
DX6

Then you can see wihat Secondary Diagnosis are associated with the account but it does not skew my financial fields.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Check the attached hope it helps

Not applicable
Author

Hello Celam,

The solution did work, however, the concatenated field looks poor and creates useless composite keys. Is there a way to clean this up so a list box would only show single codes?

Such as:

DX1

DX2

DX3

vs.

DX1,DX2,DX3

DX4,DX5

I understand this may be changing the solution entirely, however, this way I can create a crosstable that will make the correct associations. Right now it links everything together because of all the concatenated strings. 

EK