Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jpjust
Specialist
Specialist

Issue with Join

All,

I tried so hard but couldnt figure this out. Any help will be appreciated.

I have 2 queries like below.

[AppName]:

LOAD
ObjectId as ObjectID,
"App Name" as AppName,
AppId as AppID,
_AppKeyNA
FROM [lib://QVD_FOLDER/Licenses/AppNameNA.QVD]
(qvd);

[SessionNA]:
load
ObjectId as ObjectID
"Session Count"

FROM [lib://QVD_FOLDER//Sessions.QVD]
(qvd) ;

The above query gives me the correct number of records as below for an table. The datamodel will be 2 tables with join between ObjectID

AppName                              AppID                                       Session Count

ABC                                          123                                                  66,559

If I do an inner join (Because I want as a single table in datamodel), the session count just doubles (113,118)

I tried left join and the session count doubles as well.

Is there a way to keep as single table in datamodel while have the correct session count?

Thanks

Labels (1)
2 Replies
anthonyj
Creator III
Creator III

Hi @jpjust ,

It sounds like the "ObjectID" in your AppName has duplicates causing the [Session Count] to duplicate. Can you check the Data Model viewer under Preview and click on "ObjectID" in the "AppName" table. See if it says "Duplicates: True"

anthonyj_0-1646199077330.png

Thanks

Anthony

jpjust
Specialist
Specialist
Author

Thanks Anthony. There are duplicates in AppName table, so I had to use distinct  on AppName table and then 

sum(session count) with group by object ID on session table to fix the data duplication issue. Is there any other alternative approach to this?

However, I don't see the preview with "Has Duplicates" view. I am using qliksense enterprise.

Thanks