Skip to content

Summary

This session is in Urdu and English. The Pakistan Tableau User Group's third meeting, Practical Data Modeling with Tableau for Real World Dashboards, was recorded by the group on its own YouTube channel and is republished here with credit. Host Waqar Ahmed Shaikh, a senior BI engineer at ADDO AI and Tableau Ambassador, introduces his colleague Muhammad Taha, a BI engineer at ADDO AI with experience in pharmaceuticals and banking. Taha explains why the data model matters for accurate calculations, dashboard performance and avoiding duplicated rows, then traces Tableau's history from joins to data blending to relationships. In live demos he contrasts the logical layer, where tables stay separate and relationships are resolved at query time, with the physical layer, where joins merge tables into one; shows unions, including a wildcard union across files; reproduces the duplication a many-to-many join causes and fixes it with a relationship; blends a budget source onto orders as primary and secondary data sources, sheet by sheet; builds a multi-fact model of headcount, open positions, terminations and candidates around shared department and calendar dimensions; checks relationships and composite keys; compares live connections with extracts; and adds a data source filter. Waqar closes by explaining how relationships improved on joins and blending, when a physical join is still needed to widen a table, how multi-fact models bring several fact tables into one model through shared dimensions, and how blending and relationships allow data from different databases in one analysis.

Key points

  • A clean data model gives accurate calculations and aggregations, faster dashboards and fewer duplicated rows.
  • On the logical layer tables stay separate and relationships are resolved at query time; on the physical layer joins merge tables into one.
  • A many-to-many join creates a Cartesian product that inflates the numbers; a relationship on the same keys returns the correct value.
  • A wildcard union can stack files that share a naming pattern in one step.
  • Data blending works sheet by sheet with a primary and a secondary source, and has to be set up again on each sheet.
  • Multi-fact models relate several fact tables through shared dimension tables such as department and calendar; take measures from facts and dimensions from the shared tables.
  • Check a relationship by dragging the key fields from both tables into a view; a view that comes back empty means the key is wrong.
  • Extracts (.hyper) are usually faster than live connections, and data source filters keep unneeded rows out.

Jump to a chapter (15)

  1. 0:00 Welcome to the third Pakistan TUG
  2. 1:26 Muhammad Taha: practical data modeling in Tableau
  3. 2:27 What a data model is and why it matters
  4. 5:20 From joins to blending to relationships
  5. 6:49 Logical layer and physical layer
  6. 13:17 Relationships versus joins
  7. 14:40 Unions and wildcard unions
  8. 18:58 Duplication from many-to-many joins
  9. 20:24 Data blending with primary and secondary sources
  10. 26:37 Multi-fact models with shared dimensions
  11. 33:30 Composite keys and checking relationships
  12. 34:42 Live connections, extracts and data source filters
  13. 37:16 Cartesian product: join versus relationship
  14. 42:46 Waqar Ahmed Shaikh: how Tableau's data modeling evolved, and Q&A
  15. 49:58 Close

Transcript

0:02 Waqar Ahmed Shaikh: I think we have enough participants joined, uh, so let, let's formally begin. Welcome everyone, uh, for- to the third edition of, uh, Pakistan Tableau User Group. Uh, this event is all about data modeling using, uh, Tableau. Uh, my name is Waqar Ahmed Shaikh. I'm working as senior BI engineer at ADDO AI.

0:23 Apart from that, uh, I also act as a Tableau ambassador. Uh, recently we started Tableau, this, uh, Tableau user group, Pakistan Tableau User Group, and today is its third edition of the Pakistan Tableau User Group. Today we have with us Muhammad Taha. He's working, uh, with me, uh, at ADDO AI as a BI engineer. He's a very talented guy, uh, expert in data modeling, advanced calculation.

0:52 Uh, so I requested him to have a session with us, uh, for our audience and share his knowledge about data modeling in Tableau.

1:07 So I will not take much time. Uh, I request Taha to please continue or take forward. Uh, he will give hi- his introduction.

1:14 Uh, Taha, can you please, uh, share your screen and then take forward from this?

1:26 Muhammad Taha: As-salamu alaykum.

1:31 Waqar Ahmed Shaikh: Wa alaykumu s-salam.

1:35 Muhammad Taha: Hello. As-salamu alaykum everyone. Uh, this is Muhammad Taha. Uh, I am a BI engineer. Uh, I have been working at ADDO AI as a BI engineer for last two years, and, uh, I worked on several projects and my industry experiences, uh, pharmaceutical industry and, uh, banking industry as well.

1:55 So,

1:58 uh, give me just one minute. Let me share my screen.

2:17 Is my screen is visible?

2:23 Waqar Ahmed Shaikh: Yeah, we can see the screen, Taha. Please continue.

2:27 Muhammad Taha: Okay. All right.

2:32 So basically, uh, let's get started this, uh, this meetup. Uh, so this is the agenda of today's, uh, meetup. Uh, first of all, we will cover, uh, the introduction of data model, what is data model, uh, and its importance. And, uh, over the time I will cover, uh, all this the contents.

2:53 So let's come to the first slide.

2:55 Uh, first of all, we need to understand, uh, what is data model, uh, in Tableau. I will talk about all the topics that are, uh, related with in Tableau. Okay?

3:06 So basically, uh, data model is the structure and organize of the tables that we define in modeling, and so we can analyze efficiently the visualizations. For example, if we, uh, create the, uh, efficient data model, so we can analyze the visualization efficiently and, uh, make the complex, uh, calculation as well. Uh, it also help us to, uh, create the calculation, make the calculations accurate and aggregation that using in dashboards.

3:41 Or it allows us to, uh, organize the data and query performance. For example, if we create a dashboard, so, uh, the dashboard performance will be optimized if the data model, uh, made simple and, uh, accurate, and, uh, following the– followed by the best practices.

4:05 Basically, uh, in Tableau, we can, uh, connect multiple data sources, uh, in data modeling and, uh, cre– uh, drag the different tables and make the model, uh, at the logical layer. I will cover all the steps, uh, as per the Tableau.

4:25 So this is– These are the importance, why data model is important in Tableau.

4:32 It ensures the accurate analysis if we create the analysis in Tableau.

4:39 Hmm.

4:58 Basically, data model allow us to, uh, make the accurate analysis, and it also allow us to improve dashboard performance and data redundancy. So data rede– uh, data redundancy means, uh, duplications of rows, uh, in Tableau. So we can also, uh, reduce or remove the duplications of rows and tables, uh, in Tableau. It also support us to complex analysis.

5:24 For example, if we need to create, uh, the complex calculation.

5:28 Uh, so, uh, if the data models are created, uh, if, uh, if our data model create, uh, simple and accurate, so we can also make the, uh, complex, uh, calculations, uh, in the front end and avoid the, uh, hurdles.

5:50 So, uh, let me, uh, talk about– Let me talk about the history of Tableau.

5:55 So first of all, in Tableau, we have in initial time– initial time, we have just, uh, joins in Tableau. For example, traditional joins, uh, similar to Excel joins. Uh-

6:10 Like left join, right join, inner join, outer join.

6:15 So basically after that Tableau introduce the new component which is called data blending. Okay.

6:26 After that after data blending Tableau introduce the relationship. So we will cover all this topic in this meetup

6:37 further.

6:39 So let me come to the Tableau screen.

6:50 Basically this is the interface of our Tableau. Basically these are the connectors which we can connect our Tableau from the multiple sources like Microsoft Excel, text file, JSON and also the databases, other database Vertica.

7:06 So

7:09 we connect the Excel file firstly.

7:20 So basically let me explain this interface which is called this logical layer. Basically in Tableau there is a concept of logical layer and physical layer.

7:31 All right.

7:33 Basically these are the difference between logical layer and physical layer.

7:46 In logical layer we define the relationship between the tables.

7:51 But in physical layer we define the joins between the tables. So let me explain the difference between them.

7:59 Basically this is the interface of logical layer and this table is called as logical table.

8:06 All right.

8:09 This interface is logical layer and this table is logical table.

8:13 When we double click on this table we come up to physical layer.

8:19 This interface is physical layer.

8:21 So let me explain how we works, what we can do in physical layer and what we can do in logical layer.

8:31 So basically this is my table A, order table.

8:37 So

8:39 I will join another table.

8:48 So basically this is my return table. When I hover on this table so it will show the table name return table.

8:58 Basically these are the joins, joins types, how we join the tables in Tableau.

9:05 So just understand how we does

9:14 in physical layer and how we does in logical layer.

9:18 So basically this is the inner join and this is the key which I am using.

9:26 Customer ID is my key

9:29 and this also a key.

9:33 So when I check the relationship between, when I check this join is accurate or not. So we will come to the front end and just drag the customer ID here.

9:49 So basically my join works perfectly. If my join is not accurate so this view will be erased.

10:00 It will not be visible if join is not correct.

10:07 So

10:10 this is the behavior of physical layer.

10:13 So let me discuss the logical layer.

10:20 Basically this is my table.

10:50 Basically یہ ہمارا logical layer ہے۔ اس پہ ہم نے

10:55 اس کو association بنا لی۔ کہیں relationship بنا لیا۔ So basically physical layer کا ہم نے behavior دیکھ لیا تھا۔ ہم نے joins وغیرہ سارے دیکھ لیے ہیں چیزیں۔ اور یہ ہماری logical layer ہے۔ اب ان دونوں میں difference basically یہ ہے۔ اگر میں یہاں پہ آؤں گا۔

11:14 جب ہم physical layer پہ join لگاتے ہیں تو وہ table ہمارا basically اس کا part بن جاتا ہے physically flat table بن جاتا ہے۔ لیکن جب ہم logical layer پہ جاتے ہیں تو وہ tables کو separate رکھتا ہے۔ اور وہ جو joins ہم لگاتے ہیں وہ run time پہ کام کرتا ہے۔ For example یہ customer ID پہ میں نے یہاں پہ اس کی association بنائی ہوئی ہے۔

11:37 So customer ID اور دوسرے table سے جو customer ID آ رہی ہے جب میں view میں یہ والی customer ID لاؤں گا نا تب جا کے میرا association والا یہ والا relationship کام کرے گا run time پہ۔ لیکن physical layer پہ وہ immediately work کرتا ہے۔

11:57 یہ basically difference ہوتا ہے اس کے اندر ان دو layers میں۔

12:05 اور جیسے کہا بھی ہے table remain separate and tables are merged into one table.

12:11 بس اس کا ایک disadvantage ہوتا ہے physical layer پہ۔ جب ہم join لگاتے ہیں تو یہاں پہ یہ duplication بھی کر دیتا ہے لیکن logical layer پہ یہ unique رکھتا ہے record کو۔

12:27 یہ ایک difference ہے اس کا اور ہم next پہ آتے ہیں۔ یہ دیکھیں basically ایک architecture ہے اس کا ان دو layers کا کہ ان دونوں میں difference کیا ہوتا ہے basically۔ تو physical layer کے اندر ہمارے پاس basically آپ سمجھ لیں logical layer is a container of physical layer تو basically physical tables کا container ہوتا ہے logical table. صحیح ہے؟ logical table for example logical table A ہے ہمارا اس کے اندر ہمارے پاس چار table ہوں گے physical جس سے join لگ کے یہ ہمارا ایک table بن گیا ہے۔ اسی طریقے سے ہمارے پاس physical table ایک یہ ہے اور logical table یہ ہے۔ اس طرح کی یہ difference ہوتا ہے ان دونوں میں۔ اب ہم تھوڑی سی بات کر لیتے ہیں relationships and joins ان دونوں میں کیا difference ہوتا ہے basically۔ تو جیسے کہ ہم نے پہلے بھی دیکھا کہ join جو ہے وہ ایک اس table کو physical part بنا دیتا ہے دوسرے table کو دوسرے table کا بھی لیکن relationship کے اندر ہم define کر دیتے ہیں لیکن وہ view کے اندر جب ہم کوئی visualization بنا رہے ہوتے ہیں تو وہ runtime پہ وہ join جو ہے work کرتا ہے۔ صحیح ہے؟ At the query time at the runtime پہ۔ یہ دیکھیں یہاں لکھا ہوا بھی ہے اور اس میں duplication remove ہو جاتی ہیں logical relation logical relationship پہ logical layer پہ joins کے اندر duplicate ہونے کے chances کافی ہوتے

14:02 ہیں۔

14:10 Sure. اچھا ایک اس کے اندر concept ہوتا ہے union کا تو ابھی ہم تھوڑا سا اس کو بھی دیکھ لیتے ہیں union concept کو۔

14:48 میں تھوڑا سا explain کر دیتا ہوں اس میں union میں کس کو کر رہا

15:02 ہوں۔ میرے پاس ایک table ہے یہ union example 1 کے نام سے جس کے اندر five rows ہیں.

15:09 صحیح ہے پانچ rows ہیں اس کے اندر اور اس کے اندر year ہے 24 اور یہی same table میں Tableau پہ لے کر آیا ہوں تو یہاں پر بھی same آ گئی میرے پاس five rows اور year 2024 آ گیا ہے صحیح ہے؟ اب مجھے union کرنا ہے صحیح ہے؟ Union میں کیا کروں گا؟ میرے پاس ایک اور table یہاں پہ ہے جس کے اندر

15:36 جس کے اندر same rows ہیں five لیکن year 25 ہے صحیح ہے؟ تو میں union کروں گا تو یہ 10 rows ہو جانی چاہئیں تو اس کو ہم check کر لیتے ہیں اب there are multiple options ہیں ہم یہاں سے add بھی کر سکتے ہیں

15:59 اس کو اس طریقے سے دیکھیں اس کا ایک طریقہ یہ ہوتا ہے کہ یہاں سے convert to union

16:06 ہم کریں گے تو یہ ہم سے پوچھے گا کہ کون سی sheet کو کرنا ہے تو میں نے اس کو manually نہیں بتایا میں نے اس کو بولا یہاں پہ wildcard کا ایک option ہوتا ہے یہاں پہ آ کے میں نے اس کو بتا دیا کہ میری file کا نام ہوگا یہ union example.

16:25 اچھا ہماری Excel Excel file ہے تو ہم یہاں پہ لکھیں گے یہ میں نے اس کو بتا دیا اس کا نام union example ہو اور آگے کچھ بھی ہو میں نے asterisk لگا دیا اور یہاں سے میں نے OK کر دیا اس کو

16:39 تو یہ دیکھیں یہ اب ہماری 10 rows ہو گئی ہیں اور ہم year دیکھیں گے تو 2024 بھی آ رہا ہے اور 25 بھی آ رہا

16:49 ہے۔ Basically یہ دو جو files ہیں ہماری یہ union ہو گئی ہیں ہماری صحیح ہے؟ یہ ایک concept ہوتا ہے اس کے اندر اب اس کو اسی طریقے سے ہم manually بھی ہم کر سکتے تھے add union کر کے میں اس کو

17:03 specific یہاں سے اس کو میں یہ بتا سکتا تھا یہ یہاں سے ہٹانا پڑے گا یہ اور

17:22 آپ کے

17:40 دیکھیں یہ دیکھیں یہ دیکھیں یہ دیکھیں اس نے automatic وہ کر لی ہے اس کو.

17:53 اس کو OK کرا

18:01 I

18:09 think دونوں sheets کا نام same ہیں تو وہ ایک کو read کر رہا ہے اس کا نام change کرنا پڑے گا۔

18:20 یہ concept ہے union کا۔

18:26 Next ہم آ جاتے ہیں۔

18:31 اچھا ایک usually ایک example مسئلہ آتا ہے ہمیں data modeling کے time

18:38 product کا duplication ہو جاتی ہے rows میں۔ ایک example ہے ہمارے پاس اس کو بھی ہم دیکھ لیتے ہیں۔ جیسے کہ میں نے جیسے بات کر دی start میں کہ physical layer پر جب ہم join لگاتے ہیں تو وہاں پر duplication ہو جاتی ہے لیکن logical layer پر duplication نہیں ہوتی اور duplic-duplication ہونے کی وجہ ہوتی ہے many to many relationship. صحیح ہے۔

19:01 تو ابھی میں نے example یہاں پر لکھ لیا اپنے پاس۔ For example ایک order table ہے میرے پاس۔ صحیح ہے۔ میں دکھا بھی دیتا ہوں آپ کو۔ میں Excel file بھی اس لیے دکھا رہا ہوں تاکہ پتا ہو کہ ہمارے table میں data کیا ہے تاکہ ہماری understanding develop ہو جائے وہاں سے۔ تو

19:31 اب یہ میرے پاس دو table ہیں order table اور return کا table. صحیح ہے۔ اس کے اندر دونوں میں ایک key ہے customer ID کی base پر یہ جڑے گا اور دونوں میں دو دو rows ہیں میرے پاس۔ صحیح ہے۔ تو basically یہ میرے پاس order table میں already لے کر آ چکا تھا یہاں پر۔ اب میں پہلے join لگا کے دیکھتا ہوں۔

19:52 میرا return کا table تھا یہ تھا۔

20:00 اب یہ دیکھیں inner join لگ گیا اور یہ customer ID پر لگ گیا۔ اس نے rows کو چار کر دیا which is not. یہ ایک duplication کا ایک چھوٹی سی example تھی۔ یہ مسئلہ ہوتا ہے جب ہمارے پاس left side پر اور right side پر duplication ہوتی ہے تو پھر اس کو Cartesian product بن جاتا ہے جب ہم join کرتے ہیں۔ تو اس سے بچنے کے لیے ہمارے پاس یہ ہوتا ہے کہ ہمارے پاس dimension tables ہوتا ہے جس کو ہم جوڑتے ہیں۔ Fact table ایک ہوتا ہے dimension table ہوتے ہیں اس سے ہم link کرتے ہیں to avoid duplication.

20:33 ابھی میرے پاس کوئی dimension نہیں ہے۔ Left side پر بھی duplication ہے right side پر بھی duplication ہے۔ اس نے rows چار کر دی which is wrong.

20:43 یہ ایک example ہے اس کی duplication کی چھوٹی سی یہ میں نے ا, مجھے لگتا تھا important ہے تو میں نے add کر دی تھی۔

20:54 اچھا اب ایک concept ہوتا ہے اس کے اندر۔

21:14 اچھا ایک concept ہوتا ہے اس کے اندر data blending کا۔ Basically data blending کا ایک اس کے اندر functionality کے Tableau کے اندر ہم combine کر سکتے ہیں data کو from multiple sources. For example ہمارے پاس ایک data source ہے A اور ایک data source ہے B. تو ہم کیا کریں گے? ہم جب دو data source الگ الگ لاتے ہیں وہ ایک الگ الگ tab میں آتی ہے وہ as a logical table نہیں آتی۔ تو ہمیں اگر ان دونوں کے بیچ میں کوئی visualization بنانی ہے تو ہم اس کو کسی key کی base پر join basically relationship بناتے ہیں اس کا اور then وہ visualization ہم بنا لیتے ہیں۔ اور data blending work کرتی ہے sheet by sheet basis پر۔ مطلب کہ اگر میں data blending اپنی ایک sheet پر کرتا ہوں تو میں جب دوسری sheet پر move ہوؤں گا تو مجھے دوبارہ سے blending کرنی پڑے گی اس sheet کی specific visualization کے لیے۔ صحیح ہے۔ تو basically یہ concept ہوتا ہے۔ اب اس کا بھی تھوڑا سا ہم practical experi-experiment کر لیتے ہیں۔

22:36 Data blending example see.

22:49 For example یہ میرے پاس table ہے orders کا۔ یہ میں drag کرتا ہوں یہاں پر۔

22:57 صحیح ہے۔ یہ میرا ایک table ہے۔ اب مجھے کیا کرنا ہے data blending کرنی ہے۔ تو data blending ا, میرے پاس ایک اور table ہے budget کا۔ یہاں پر جیسے کہ میں دکھاتا ہوں آپ کو۔

23:24 ہمm, یہ میرے پاس budget کا table ہے جس کے اندر data یہ رکھا ہوا ہے region segment اور budget quantity.

23:32 کیا کروں گا? اس میں میں یہاں پر جا کر new data source ہے اس پر add کروں گا Excel file ہے اور وہ جو میری budget والی file ہے ا, وہ میری ہے یہاں پر۔ یہ میں لے کر آ گیا۔

23:49 اب اس نے ایک نیا instance کھول دیا Tableau کا۔ لیکن جب میں یہاں پر دیکھوں گا تو میرے پاس صرف دو آ رہی ہیں data sources. اب اس میں سے میری ایک primary data source ہوگی اور ایک secondary data source ہوگی۔ صحیح ہے۔ تو basically پہلی والی جو تھی میری وہ primary ہے دوسری والی جو میں نے ابھی add کری ہے وہ secondary ہے۔ میں یہاں sheet one پر آؤں گا تو یہاں پر آ کر مجھے یہ دیکھیں دو الگ الگ basically data sources دکھ رہی ہے۔

24:15 یہ الگ الگ دکھ رہی ہیں۔ اب مجھے ان کا relationship بنانا ہے کیونکہ مجھے region لے کر آنا ہے order سے segment لینا لے کر آنا ہے order سے اور مجھے measure دیکھنا ہے ا, دوسری والی data source سے تو basically میں کیا کروں گا? یہاں پر data میں آؤں گا۔ Edit blend relationships.

24:33 یہاں پر آنے کے بعد اب دیکھیں اس نے automatic یہاں پر detect کر لیا کہ یہ common keys ہیں ہمارے پاس ا… دونوں data sources میں۔ صحیح ہے۔ تو یہاں سے ہم اس کو edit کر سکتے ہیں۔

24:51 automatic پر edit نہیں ہوگا۔ یہ custom پر edit ہوگا۔

24:55 یہاں سے۔ یہاں سے ہم اس کو کوئی بھی وہ بتا دیں گے key تو یہاں پر یہ automatically کر دے گا۔ ہم یہاں سے add بھی کر سکتے ہیں۔ یہاں پر add پر جانے کے بعد کوئی اور تیسری key ہے تو وہ بھی ہم ڈال سکتے ہیں۔ تو یہاں سے OK کر دیتا ہوں۔ اب میں basically region لے کر آتا ہوں۔ ا…

25:38 region base پر کرتی ہوں۔ یہ دیکھیں میں نے region کی base پر basically relationship بنایا تو یہاں پر میرے پاس ایک اس کا آ گیا کہ یہ region کی base پر link ہوا ہوا ہے۔ budgeted quantity میں یہاں سے لے آتا ہوں۔ تو یہاں پر یہ link جو بنا ہوا ہے میں ایسے اس کو بند بھی کر سکتا ہوں۔

26:10 ایسے کھول بھی سکتا ہوں۔ دیکھیں اوپر یہ blue tick بھی آ گیا, orange tick بھی آ گیا۔ ا… یہ میری secondary data source ہے۔ وہ میری primary data source ہے۔ basically یہ concept ہے ا…

26:22 data blending کا جس میں ہم جو ہے basically ا… multiple data source سے data کو ا…

26:29 tables کو join کرتے ہیں data sources کو اور visualize اپنا کوئی جو بھی, جو بھی object ہوتا ہے جو بھی visualization ہمیں بنانی ہے وہ ہم بنا سکتے ہیں۔ ہمیں اگر key کچھ edit کرنا ہے تو یہاں پر آ کر ا…

26:41 یہاں سے کر سکتے ہیں automatic پہ۔

26:46 یہ بن گیا ہے۔ دیکھو اب یہ دو پر بن گیا۔ مطلب segment پہ

26:52 دو پر blending ہو گئی ہے ہماری۔

26:57 یہ basically data blending کا ا… concept ہوتا ہے table کے اندر۔

27:15 اس کے علاوہ ہمارے پاس

27:25 جس کے بعد ہمارے پاس ایک concept ہے modeling کے اندر multi fact کا basically concept ہوتا ہے جس کے اندر ہم ا… اپنے multiple fact tables کو اپنے model کا part بناتے ہیں اور جو کے work کر رہے ہوتے ہیں common shared da ا… dimension table سے۔ ا…

27:41 for example, ایک sale کا table ہے اور ایک budget کا table ہے اور ان دونوں پر product ID آ رہی ہے۔ تو میرے پاس ایک product کا بھی تیسرا table ہوگا dimension table جس کو میں دو fact tables سے link کروں گا تو product wise میرے پاس sales بھی آ جائے گی اور budget بھی آ جائے گا۔ ایک چھوٹی سی example کی اس کا ایک practical ہم لوگ کر لیتے ہیں۔ ا…

28:03 اس طرح سے کرتے ہیں۔

28:42 یہ basically ہمارے پاس ایک dataset تھا۔ ا…

28:46 اس کے اندر ہمارے پاس multi fact tables ہیں۔ ا…

28:49 for example, یہ دیکھیں active headcount.

28:52 اس کو میں نے drag کرا۔ یہ میرا fact table ہے۔ اس کے اندر اگر میں دیکھوں گا تو میرے پاس یہ ساری چیزیں آ رہی ہیں۔ Description data بھی آ رہا ہے۔

29:02 صحیح ہے۔ اس کے علاوہ میرے پاس اس کے اندر open position کا ہے table.

29:11 یہ دوسرا fact table ہے۔

29:15 اور اس کے علاوہ میرے پاس ہے termination کا ایک table ہے۔ اور ایک department کا میرے پاس dimension table ہے جو کے میں link ہوگا ان تینوں سے۔ department ID کی base پر یہ basically ا… joint ا… association بن گئی, relationship بن گیا اس کا۔ ا… اور دوسرے fact table سے اس طریقے سے اس کو میں link کر دوں گا۔

29:44 تو اس نے automatically detect کر لیا department ID. وہاں پر بھی ہے, وہاں پر بھی ہے۔ اب termination سے بھی میں اس کو link کروں گا۔

29:53 کیونکہ department ID یہاں پر بھی تھی تو اس نے automatically اس سے بھی detect کر لیا۔ اب میں front end پر آ کر department wise

30:04 for example, یہ department آ رہا ہے تو اس کے according میں اس active headcount سے بھی کچھ دیکھ سکتا ہوں۔ supervisor کا ایک measure ہے میرے پاس میں یہاں سے بھی دیکھ سکتا ہوں۔ تو یہ دیکھیں یہ بن گیا اور اسی طریقے سے open positions کے اندر سے supervisor آ رہا ہے۔ یہ بھی دیکھ سکتا ہوں۔ یہ بھی بن گیا۔ termination سے بھی supervisor آ رہے ہیں۔ یہ بھی بن گیا۔ تو یہ اس نے بالکل صحیح ہمارا association بنائی ہے۔ اور association work بالکل ا…

30:30 run time پر کرتی ہے مطلب immediately نہیں کرتی work for example اگر میں Department wise Active Headcount میں سے کچھ دیکھ رہا ہوں تو یہ جو Relationship ہے یہ تبھی کام کرے گا جب میں ایک View کے اندر both Table سے کچھ لے کر آؤں گا۔

30:48 For example Department میرا یہاں پہ آیا ہوا ہے Active Headcount کے اندر سے میں یہ لے کر آیا۔ تب جا کے میرا وہ جو Association والی Key ہے وہ کام کرے گی Run Time پہ مطلب immediately نہیں کرتی وہ کام۔ تو یہ ایک Fact Table Multi Fact Table کا basically concept ہوتا ہے جو کہ ہمیں پتہ ہونا چاہیے بالکل۔ اس کے اندر اور Tables ہیں Candidates کا بھی ایک Table تھا

31:18 اور ایک Calendar کا basically Table

31:32 ہے۔ اب یہاں پہ Dates کی Base پہ join کریں گے اس کو۔

31:53 یہاں پہ candidate interview کی تاریخ۔

32:09 اس Fact Table سے میرے پاس۔ اب یہ Date کی Base پہ میں نے یہ تینوں Tables کو join کر دیا اب یہ for example میں کچھ بھی دیکھ لوں۔ یہ ایک Multi Fact Table کا concept ہے اب میں for example کوئی بھی Dashboard میں ہمارے Filter ہوتے ہیں جو کہ ہر objects پہ کام کر رہے ہوتے ہیں۔ تو for example Dashboard پہ ہم جب Date کا Filter دیں گے وہ ہمارا اس والے Fact Table پہ بھی کام کرے گا، اس پہ بھی کام کرے گا، اس پہ بھی کام کرے گا Termination پہ بھی۔ اسی طریقے سے Department کا Filter بھی ہو گا وہاں پہ تو وہ اس پہ بھی کام کرے گا جس جس سے Link بنا ہوا ہے جس Fact سے Link بنا ہوا ہے اس پہ کام کرے گا۔ اور ایک اس میں Practice یہ کرنی چاہیے ہمیں کہ ہمارے پاس جو Measures ہوتے ہیں نا وہ ہمیں Facts سے لے کر آنے چاہیے اور جتنی بھی Dimensions ہوتی ہیں نا وہ Dimension یا Shared Dimension Tables سے ہمیں لے کر آنی چاہئیں وہ properly work کرتے ہیں۔ اور ایک اس کی ایک Practice ہوتی ہے basically وہ بھی میں بتاؤں گا۔ وہ یہ ہوتی ہے for example یہاں پہ ہمارے پاس ایک Option ہوتا ہے Edit Calculation یہ ایک basically Relationship Calculation ہوتی ہے جہاں پہ ہم Keys بناتے ہیں۔ اب یہاں پہ Composite Key بھی بنتی ہے اور Primary Key Normal Simple جو Key ہوتی ہے وہ بھی بنتی ہے تو اب Composite Key بنانے کے بھی دو طریقے ہوتے ہیں۔ For example میں اگر بتاؤں اس کے اندر Dimension دیکھ لوں میں کیا کیا آ رہی

33:57 ہے۔ Department Employee ID اب ہم یہاں سے اس کو

34:04 Department ID, Employee ID plus کا sign لگا کے بھی کر سکتے ہیں یہ concatenate ہو جاتا ہے۔ یہ تو خیر اب Integer ہے تو یہ اس کو add کر دے گا۔ ایک طریقہ اس میں یہ ہوتا ہے کرنے کا Composite Key بنانے کا اور second طریقہ ہوتا ہے Add More Fields یہاں سے جا کے اور Field ڈال دیں یہاں پہ۔

34:28 یہاں پہ خیر آ نہیں رہا ابھی تو اس طریقے سے ہم Composite Key بنا لیتے ہیں یہاں پہ اور ہمیں جب Relationship check کرنا ہوتا ہے کہ ہمارا Relationship صحیح بنا ہے یا نہیں بنا تو ہم یہ ہم نے جیسے کہ یہاں پہ دو Field ڈالی Key ڈالی اب ہم آگے آئیں گے اور دونوں Table میں سے same ہم لوگ Fields گرائیں گے۔

34:48 Date ہاں اب یہ دیکھیں گے Date ہے اس میں 2000 کی ساری Dates آ رہی ہیں لیکن میں جب Calendar Date لاؤں گا

34:57 تو صرف 2023 اور 2024 just matching record لا رہا ہے وہ جو کہ properly کام کر رہا ہے ہمارا Relationship بالکل صحیح بنا ہوا ہے۔ اگر ہماری Key صحیح نہیں بنتی تو یہ View بھی invisible ہو جائے گا مطلب غائب ہو جائے گا ہمیں دکھے گا نہیں یہ That means کہ ہمارا Relationship میں کوئی issue ہے مسئلہ ہے یہ basically ایک وہ ہوتا ہے Key check کرنے کا طریقہ کہ Relationship check کرنے کا طریقہ کہ ہماری Key صحیح کام کر رہی ہے یا نہیں کر رہی تو یہ ساری چیزیں basically اس میں ہوتی ہیں۔

35:33 اور اس کے علاوہ

35:39 Relationship Square

35:42 اب یہاں۔

35:50 Okay اچھا اس کے اندر basically اب تھوڑا سا اس Interface کو ہم discuss کر لیتے ہیں کہ اس کے اندر ہمارے پاس کیا کیا basically Options ہوتے ہیں۔ ایک تو یہ Connection Type ہوتی ہے basically Extract اور Live All right Live Connectivity یہ ہوتی ہے کہ simple Database سے connect کرا ہوا ہے ہم نے اور بس وہ Front end پہ چل بھی گئی چیزیں اور وہ Run Time پہ مطلب کہ آپ کچھ بھی visualization بنائیں گے تو وہ Run Time پہ Query execute کرے گا اور اس کا output لے کر آئے گا Which is not recommended because یہ slow ہوتا ہے۔ For example اگر SQL Server سے Connectivity بنائی ہوئی ہے اب ہم کچھ object بنا رہے ہیں کوئی تو وہ services slow بھی ہو سکتی ہیں ہماری کیونکہ SQL Server down ہوا ہوا ہے کبھی تو کچھ ہوا تو وہ Loading پہ ہی execution پہ ہی اٹکا رہے گا کافی time تک تو اس کی practice یہ ہوتی ہے کہ ہم اس کا extract بنا لیتے ہیں which is stored in dot hyper file.

36:42 Hyper file میں اس کی basically جتنی بھی rows ہوتی ہیں وہ ساری store کرتا ہے، اس hyper file کو ہم use کریں گے اپنی analysis بنانے کے لیے وہ fast ہوتا ہے۔ تو basically یہ ایک طریقہ ہوتا ہے۔ اس کے علاوہ اس طرف ہمارے پاس basically data source filters ہوتے ہیں، یہاں پہ۔ اب یہاں پہ ہم data source filter بھی لگا سکتے ہیں to restrict the data تاکہ آگے load نہ پڑے for example میں اگر دیکھوں،

37:15 یہ کیا ہے؟ candidate name ہے، ابھی دیکھیں میرے پاس اس کے سارے candidate name آ رہے ہیں، صحیح ہے؟ اب مجھے filter لگانا ہے صرف مجھے یہ والا candidate چاہیے تو یہاں پہ میں data source level پہ آؤں گا، add کروں گا یہاں سے

37:34 candidate name

37:57 یہ آیا، یہ ایک میں نے select کر لیا یہاں سے اور اس کو لگا دیا، okay.

38:03 اس کو restrict کر دیا یہاں سے اب میں جب آگے آؤں گا تو مجھے just ایک candidate دکھے گا۔ یہ ایک data source filter ہوتا ہے اور یہ ہم یہاں پہ use کر سکتے ہیں restrict کرنے کے لیے data کو تاکہ آگے load نہ پڑے ہمارے پاس content پہ زیادہ rows نہ آئیں جو ہمیں چاہیے بھی نہیں وہ بھی ہم لے کر لا رہے ہیں تو وہ غلط ہے، اس کو یہاں سے remove کر دیں

38:27 گے، okay.

38:30 Remove کر دیا، okay.

38:33 تو یہ basically یہ ہو جاتا

38:41 ہے۔ اچھا، اس کے علاوہ ایک example ہم وہ والی بھی دیکھ لیتے ہیں Cartesian product والی。

38:53 Cartesian product basically ایک duplication ہوتی ہے rows کی جو کہ many to many relation پہ ہوتی

39:10 ہے۔

39:31 Basically میں آپ کو دکھاتا ہوں پہلے میرا data set کس طریقے سے ہے، کیا ہے؟ یہ دیکھیں۔ اب میرے پاس یہ basically consumer کا segment ہے جس کے آگے ₹20,000 budgeted quantity ہے، صحیح ہے؟ اب میں آتا ہوں Tableau پہ، یہاں پہ میرا orders کا table ہے اور یہاں پہ میں ایک اور add کرتا ہوں excel file، میری budgeted quantity والی file.

40:15 صحیح

40:19 ہے؟ یہ میں نے basically سب سے پہلے اس کو ہم join کریں گے۔ میرا basically مقصد یہ ہے یہ activity کرنے کا، مجھے Tableau level پہ یہ نمبر دکھانا ہے اس segment کے آگے، central region کے اندر consumer کے segment کے آگے ₹20,000 دکھنے چاہیے لیکن میں orders میں گیا، میں نے join لگا کے میں دکھاؤں گا یہ your budgeted quantity یہ میں نے join کیا، صحیح ہے؟ یہاں پہ region کی base پہ already ہوا ہوا ہے میں segment کی base پہ بھی لگا دیتا

41:03 ہوں۔ اس کو inner کر دیا، اب ہم دیکھیں گے کہ اس کا behavior کیا ہے؟ میرے پاس وہ نمبر آتا ہے یا نہیں؟ See this.

41:21 Budgeted quantity.

41:28 تو میرے پاس یہ نمبر آپ دیکھیں یہ غلط آ رہے ہیں، یہ نہیں آنا چاہیے کیونکہ وہ join کر رہا ہے اور وہ Cartesian بن رہا ہے اس میں۔

41:41 اب میں اس کو، میں بس difference دکھانا چاہ رہا ہوں physical layer اور logical layer پہ تو یہاں پہ آ کے اب اس کو same relationship بناؤں گا association سے same, same key پہ۔

42:11 اب دیکھیں میرا نمبر automatically صحیح ہو گیا تو یہ ایک فرق ہوتا ہے association میں relationship بنانے میں اور join لگانے میں physical layer پہ۔

42:25 تو basically یہ کچھ important points تھے data modeling کے حوالے سے جو ہم نے cover کیے ہیں

42:36 کے علاوہ اور چیزیں تو نہیں ہیں I think یہی ہے بس ساری چیزیں

42:42 So Waqar bhai, we can conclude the session.

42:47 Waqar Ahmed Shaikh: Thank you so much Taha for this amazing session. Participants, if you have any question, please go forward and ask them so we can address. اچھا, میں تھوڑا سا یہاں پر اپنا بھی کچھ input دینا چاہوں گا کہ basically Taha نے اس طرح سے start کیا تھا۔ So جب initially Tableau start ہوا تھا اس time پر ہمارے پاس joints تھے۔ But joints did have their own limitation.

43:08 اس time پر ہمارے پاس Cartesian product بنتا تھا اور notification ہوتی تھی, aggregation کے problems آتی تھی۔ So Tableau come up with the idea of data blending late in I think 2018 تک جو ہے ہمارے پاس data blending اور 19 تک ہم data blending use کر رہے ہوتے تھے to cater all those problems.

43:27 Then I think 2021 میں Tableau gain some of the advanced more versatile or evolution of data modeling in terms of by using data relationship جو ابھی تک کا Tableau کا advance ایک feature ہے جس کے اندر آپ کو physical join کرنے کی ضرورت ہی نہیں پڑتی۔ آپ runtime basis پر صرف noodles کے basis پر جو Taha نے آپ کر کے دکھائے تھے, آپ join کرتے ہیں۔ وہاں پر آپ کو left, right اور inner outer type کی join مطلب اس میں آپ کو joint type ہی define نہیں کرنی پڑتی۔ You just have to have a matching key اس کی basis پر join کر دیتے ہیں اور آپ کے front end پر result آنا شروع ہو جاتا ہے۔ Tableau runtime basis پر detect کر رہا ہوتا ہے کہ کس قسم کا join آپ کے لیے بہتر ہوگا اور اس کی efficiency بھی joint سے بہتر ہوتی ہے کیونکہ وہ runtime پر ہو رہا ہے۔ آپ کا active expand نہیں ہوتا physically تو ہمارے پاس ایک data volume بھی نہیں بڑھتا۔ جیسے one big data table کا ایک concept ہوتا ہے joints کے اندر وہ بھی یہاں پر نہیں آتا کیونکہ آپ کا data دونوں الگ الگ۔ کیونکہ ہم آپ کو پتا ہے BI world میں normalize data پر کام کر رہے ہوتے ہیں۔ Data ہمارا silos میں الگ الگ table کے اندر exist کرتا ہے۔ ہمیں data modeling کی need اسی آتی ہے کہ ہمیں کسی طرح سے دو tables کو آپس میں ملانا ہوتا ہے, باتیں کرنی ہوتی ہے۔ کسی نہ کسی basis پر analysis کرنا ہوتا ہے۔ دو یا تین multiple دو تین تو میں example دے رہا ہوں۔ ہم تو tens of hundreds of tables کو آپس میں ملا کر model data modeling کر رہے ہوتے ہیں۔ تو Tableau کی relationship وہاں پر اس لیے efficient ہو جاتا ہے کہ آپ کے جو table آپ نے call بھی کر لی ہے اپنے data model کے اندر and again they are working independently until and unless you make visualization on the sheet level.

45:13 تو جب sheet level پر visualization بن جاتی ہے تب وہ آپس میں link توڑتے ہیں اور وہاں پر بھی اس حد تک limit link ہوں گے جو آپ fields اپنی sheet کے اوپر call کریں گے۔ Otherwise باقی چیزیں independent رہتی ہیں تو data آپ کا expand نہیں ہوتا unnecessarily.

45:30 So again اگر آپ میں سے کسی کو کوئی question ہے, کسی کو confusion ہے۔ There is a lot of material available on the thought کہ اس طرح کا session ہونے چاہیے awareness بڑھتی ہے۔

45:46 There is a question, Abdullah where does the performance comes in as a beginner in the data modeling this not seem to be an appropriate solution for complex dashboard files containing multiple worksheets.

45:57 اچھا, دیکھیے آپ کا جو سوال ہے نا وہ Abdullah وہ need basis پر ہوتا ہے۔ sometime ہماری requirement ایسی ہوتی ہے آپ نے اگر SQL کے اندر CTE کا پڑھا ہو concept تو ہمارے پاس کچھ ایسے بھی scenarios ہوتے ہیں جب ایک table کے اندر certain fields ہی نہیں ہے تو ہمیں دوسرے table کی need ہوتی ہے اس کو بڑا بنانے کے لیے۔ Then اس کے بعد ہم joints ہٹاتے ہیں relationship کے through for using dimensions.

46:25 تو وہاں پر joints mandatory ہو جاتے ہیں کہ آپ کو اپنے existing table کو بڑا کرنا ہے۔ اس میں further field add کرنی ہے اور اس field کی basis پر آپ چاہ رہے ہیں کچھ اور further data reflect کرنا, right?

46:39 تو وہاں پر ہم relationship دو جگہ پر مطلب ایک جگہ پر آپ نے internally ایک inner join یا پھر left join لگا لیا۔ آپ کا ایک physical table complete ہو گیا۔ پہلے مثالیں کہ اس کے اندر 10 column آ رہے تھے۔ Join کے بعد اس کے اندر 12 column ہو گئے۔ دو آپ نے اس کے اندر add کر دیے۔ اب وہ permanent اس table کا part بن گئے, right?

47:01 اس کے بعد آپ further جو بھی relationship بنانا چاہے وہ logical layer سے بنائیں which is a most appropriate solution for now. اس کے اندر آپ– اب تو جو ہے کافی complex type کی Tableau نے enable کر دیے جب سے یہ multi-fact data modeling کے features introduce کروائے۔ Multi-fact کیا ہے? Multi-fact کیا ہوتا ہے? پہلے ہمارے پاس ایک اور limitation تھی even after its data blending کہ ہم جو ہے multiple جو کیونکہ آپ normal جو enterprise level پر جو solutions ہوتے ہیں اس کے اندر آپ کی جو fact tables ہوتے ہیں نا جیسے sales کا table ہے یا آپ کے orders کا table ہے وہ آپ کے fact tables ہوتے ہیں۔ وہ ہم multiple نہیں لا سکتے اپنے data model کے اندر۔ But multi-fact data table allow modeling allow us to bring multiple fact and join them using the shared dimension.

47:55 For example میں نے orders لیا ہے, sales لیا ہے اور اس کے against میں میں product کے نام لانا چاہ رہا ہوں۔ تو میرے یہ دونوں table product کے نام سے link ہو جائیں گے اور to bring product name into my sales and order table.

48:09 Getting the point? So یہ چیز ہوتی ہے اور اس کے علاوہ آپ اس کو further date سے بھی combine کر سکتے ہیں۔ So یہ تھوڑا سا مطلب overall تھوڑا سا complex ہے جب تک آپ ان چیزوں میں گھسیں گے نہیں, تھوڑا سا trial and error نہیں کریں گے you will not get the idea. لیکن for now میں جو ہے آپ اس کے touch رہیں۔ Inshallah ہم اس پر اور بھی session کرنے کا ارادہ رکھتا ہوں میں۔ Data modeling is a very broad topic تو ایک گھنٹے میں جتنا ہم cover کر سکتے تھے, ہم نے کوشش کی ہے۔ I hope کہ میں نے آپ کا answer کر دیا ہوگا۔ If anyone else has question تو please go forward

49:00 جان کر اور ایک اور بات کہ پہلے ایک اور limitation تھی کہ ہم multiple data sources، for example میری data source exist کرتی SQL میں، دوسری exist کرتی SAP HANA میں، تیسری exist کرتی ہے Oracle کے اندر۔ تو جب تک joins تھے ہم آپس میں اگر میں model بناؤں گا تو صرف ایک سے بنے گا، multiple سے نہیں بنتا تھا۔ Data blending نے ہمیں اس چیز کے لیے بھی capable کیا کہ ہم ایک ہی model کے اندر Oracle سے بھی data لا سکتے ہیں، SQL سے بھی لا سکتے ہیں، Excel file سے بھی لا سکتے ہیں، Hyper Extract جو Tableau کی اپنی file ہوتی ہے اس سے بھی لا سکتے ہیں۔ Relationship تو اور advance سے لگ گیا کہ وہ تو اس میں تو مسئلہ ہی نہیں، آپ side میں manage کر رہے ہوتے ہیں۔ So this is the case.

49:42 آپ نے جو سوال پوچھا تھا اس کے اندر پڑھ رہا تھا کہ containing multiple worksheets، تو multiple worksheets کے علاوہ you can have multiple connection type as well.

49:53 Muhammad Taha: Exactly.

50:00 Waqar Ahmed Shaikh: Anyone?

50:03 Yes، شایع صاحب، Profaza thanks for joining. شایع صاحب ہمارے کافی regular participants ہیں۔

50:13 شایع صاحب آپ کچھ share کرنا چاہیں گے؟ میں آپ کا mic on کر رہا

50:19 ہوں۔ All right guys thank you so much for joining.

51:02 Okay no problem شایع صاحب۔ Anyone if they want to ask a question through microphone I can switch on their mic.

51:13 Please let me know.

51:25 All right thank you so much everyone for taking out the time during Ramadan and for this session. I hope کہ یہ session سب کے لیے تھوڑا useful رہا ہو گا۔ Obviously topic کا time ہمارا بہت short تھا۔ We tried to cover as much as possible.

51:39 Thank you طہہ for this amazing session taking out the time.

51:44 I will after this session you will get the questionnaire and feedback form. Please do share your feedback about this session. We will try to conduct more session very frequently Inshallah in the coming month.

51:57 So thank you. Thanks once again.

52:00 Muhammad Taha: Thank you وقار بھائی۔

52:00 Waqar Ahmed Shaikh: Take care.

52:07 اللہ حافظ۔

52:10 Muhammad Taha: اللہ حافظ۔

Leave a comment

Your email address will not be published. Required fields are marked *