Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
siddheshmane
Creator
Creator

Need a little help on this..

Hi all,

I have created a qlikview doc. where in one doc I linked the tables removing the syn keys and in the other doc I just loaded the  same data and did not remove the syn keys.

I am getting a major difference in the =Count(UnitPrice) [The Text Object].. When i check the UnitPrice field in both the docs, i see that the data without the syn keys has less data than the other.

Capture.PNG

The above image is the data after removed the syn keys....

Capture2.PNG

This data is just a raw data loaded with the syn keys..

My question is whether or not the data is correct.

Thanks.

1 Solution

Accepted Solutions
danieloberbilli
Specialist II
Specialist II

When I look at the two data model screenshots:

the first data model (on top without syn. keys) has only one field UnitPrice in one table (FactTable). So count(UnitPrice) will only count the values in this particular field in this particular table.

In the second model (with syn keys) you count UnitPrice values in table OrderDetails and Products...so you probably count a lot more values than you intended and get a wrong result.

View solution in original post

7 Replies
vishsaggi
Champion III
Champion III

Hello Siddhesh,
I have just used some test data and checked dont know I have found no difference actually when counted on one of the fields. I might be wrong, Just wondering if you could send an image from Table Viewer that shows syn keys at your end.

siddheshmane
Creator
Creator
Author

Hi vishsaggi,

Here are the two models that i have generated.

export1.png

export2.png

danieloberbilli
Specialist II
Specialist II

I think the question is which of your data tables contain the number of UnitPrice that you actually want to count.

For example: if UnitPrice was in two tables they should have caused a syn. key (if there were other keys as well) which you probably removed by renaming the fields like tab1: UnitPrice and tab2: UnitPrice_other.

If you have a messy data model with syn. keys and count (Field) then Qlik will count all possible values/rows - no matter if they are from the 'right' table to look at.  

siddheshmane
Creator
Creator
Author

Hi Daniel,

Could you please explain it more. I'm sorry, I'm a complete newbie at this so i couldn't understand it clearly.

I am also attaching the qv files if it could help.

Thanks.

danieloberbilli
Specialist II
Specialist II

When I look at the two data model screenshots:

the first data model (on top without syn. keys) has only one field UnitPrice in one table (FactTable). So count(UnitPrice) will only count the values in this particular field in this particular table.

In the second model (with syn keys) you count UnitPrice values in table OrderDetails and Products...so you probably count a lot more values than you intended and get a wrong result.

siddheshmane
Creator
Creator
Author

Thank you Sir,

Helped me a lot. Thanks again.

danieloberbilli
Specialist II
Specialist II

Your are welcome