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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Krish2459_58
Creator II
Creator II

data model suggestion

Hi, 

I have two tables Lease and Unit where one lease can have multiple Units.

I have to bring unit information into the lease table whic causes the sum(area) mutilplied like below.

Attached the sample data.Please have acheck.

 

Krish2459_58_0-1718879709966.png

 

 

 

Labels (2)
1 Solution

Accepted Solutions
marcus_sommer

Both tables associated per Lease ref should return the correct sum() per row as well as in the total respectively only on the Lease ref level. Displaying it on an unit ref level has no added value else only potential to confuse the users.

If there should be for other reasons a join of the tables needed you may add an extra information of how many units a lease has, something like:

join(Lease) load LeaseRef, count(UnitRef) as Count resident Unit group by LeaseRef;

and within the UI an expression may look like:

sum(Area / Count)

View solution in original post

2 Replies
Gaël
Contributor III
Contributor III

Based on your very short description, I guess Sum(DISTINCT Area) is what you need (assuming no two areas are equal).

marcus_sommer

Both tables associated per Lease ref should return the correct sum() per row as well as in the total respectively only on the Lease ref level. Displaying it on an unit ref level has no added value else only potential to confuse the users.

If there should be for other reasons a join of the tables needed you may add an extra information of how many units a lease has, something like:

join(Lease) load LeaseRef, count(UnitRef) as Count resident Unit group by LeaseRef;

and within the UI an expression may look like:

sum(Area / Count)