YouTube2Text

Data Analysis using AI Tools | Quadratic | N8N | Supply Chain — Transcript

by codebasics · 10,289 words · 1,502 segments · language en · Watch on YouTube

Full transcript

  1. 0:00We are going to build end to end
  2. 0:01analytics projects using AI tools in
  3. 0:04supply chain domain. In terms of text
  4. 0:06tech, we will use Netn which is an AI
  5. 0:09workflow automation tool to pull data
  6. 0:12from Excel files and it will ingest the
  7. 0:14data into Postgress SQL database. Then
  8. 0:17we will use another AI tool called
  9. 0:20quadratic which is an AI powered
  10. 0:22spreadsheet that will pull data from
  11. 0:24Postgress SQL database and we'll show
  12. 0:26you how you can perform analytics using
  13. 0:29some prompts in this quadratic tool.
  14. 0:31This project will teach you important
  15. 0:34supply chain domain concepts as well as
  16. 0:36it will teach you how you can build
  17. 0:38projects using the modern AI tool
  18. 0:41mindset. This project is not only uh
  19. 0:44perfect for your learning but it is
  20. 0:46something you can add in your resume as
  21. 0:48well as your project portfolio. Let's
  22. 0:50begin with some interesting story line.
  23. 0:55Atlart is a Gujarat based organic food
  24. 0:58manufacturer. They specialize only in
  25. 1:01few products but disrupted the market in
  26. 1:04the two cities they operate.
  27. 1:07In an interesting move, they opened
  28. 1:10their third city of operation in New
  29. 1:13Jersey, America, and started performing
  30. 1:16well there as well. Though they handle
  31. 1:19very less products, their supply chain
  32. 1:22is immature. Bruce Hurali, the chief
  33. 1:26operating officer of Atlique Mart, has
  34. 1:28noticed that some of their supermarket
  35. 1:31customers are dissatisfied with their
  36. 1:34order management and he wanted to fix
  37. 1:37this before scaling further. Bruce
  38. 1:40discussed this with Tony Sharma, the
  39. 1:43head of analytics at Atlake Mart and
  40. 1:46understood the problem is a classic
  41. 1:49supply chain issue where they are not
  42. 1:52able to maintain an optimum inventory.
  43. 1:54Tony offered to create a quick insights
  44. 1:57report using Excel or PowerBI, but Bruce
  45. 2:02insisted that he needs something AI
  46. 2:04powered as a solution because like any
  47. 2:08other senior leaders in the world, Bruce
  48. 2:10does not want to miss out on the AI
  49. 2:13hype. Tony assigned this work to Peter
  50. 2:16Pande who is a curious data guy in the
  51. 2:20team exploring all the AI tools in the
  52. 2:23market. Peter, who always thrives to
  53. 2:26drive the extra mile, found quadratic,
  54. 2:31which is an AI powered spreadsheet that
  55. 2:34even offers connection to their database
  56. 2:37in Postgra DB. He even figured out an
  57. 2:41automation using N8N to migrate the data
  58. 2:45directly from emails to Postgra.
  59. 2:49So you will be solving the supply chain
  60. 2:52problem along with Bruce, Tony and Peter
  61. 2:56using Quadratic, the AI powered
  62. 2:59spreadsheet N8N to automate the data
  63. 3:02migration and learn important supply
  64. 3:05chain domain experts. Let's get started
  65. 3:08folks.
  66. 3:11[Music]
  67. 3:20Let us discuss the technical
  68. 3:22architecture for this project. We will
  69. 3:24get our data through email.
  70. 3:27You'll get these kind of emails which
  71. 3:29will have files attached to it. I have
  72. 3:33two emails. One for India sales, one for
  73. 3:35USAS sales. And when I open this email,
  74. 3:38I will see this kind of CSV file where
  75. 3:41this file contains aggregate data. You
  76. 3:44can see order ID, customer ID, order
  77. 3:47placement date and few other fields. The
  78. 3:49second file contains the order line
  79. 3:53items. So order ID, order placement ID
  80. 3:56and there are some detailed fields like
  81. 3:58the product ID, the order quantity and
  82. 4:02so on. So all of these data is coming
  83. 4:06via email in your inbox. And by the way,
  84. 4:10we are going to provide you these files.
  85. 4:12So what you can do is you can take these
  86. 4:15files and you can send it to your own
  87. 4:18email and you can configure your
  88. 4:22automation workflow to monitor that
  89. 4:24email. So let's talk about the
  90. 4:26architecture. So here are the emails
  91. 4:29that you're getting and they have this
  92. 4:31uh spreadsheet attached to it and then
  93. 4:35you are using uh let me just draw one
  94. 4:38more block here. So you are using this
  95. 4:42tool N8N for the automation. Okay. And
  96. 4:47this tool is basically
  97. 4:51an AI agentic automation tool and it is
  98. 4:57monitoring
  99. 4:58these uh emails. So you can configure it
  100. 5:02to monitor your email inbox. You can
  101. 5:06provide the labels, the subject line,
  102. 5:09you can provide all that filtering.
  103. 5:10Okay. And as a next step what you're
  104. 5:12doing is you are ingesting the data uh
  105. 5:17into your posgress. So here will come
  106. 5:21your posgress database. Okay. So this is
  107. 5:26your posgress database and then you are
  108. 5:29attaching the quadratic AI. So let's say
  109. 5:33I have my
  110. 5:35quadratic tool. Uh it is your AI
  111. 5:38spreadsheets.
  112. 5:40So you are pulling data from posgress
  113. 5:45into quadratic and here you are doing
  114. 5:49your analysis your promptbased
  115. 5:52AI analysis is being done in the
  116. 5:54quadratic. So this will be your
  117. 5:56architecture. Just to summarize, emails
  118. 5:58are coming to specific inbox and this is
  119. 6:00what happens in the industry where some
  120. 6:04vendors or let's say some team member
  121. 6:06will be sending all these Excel files
  122. 6:09via email in specific email ID and inbox
  123. 6:13and you can configure your N to monitor
  124. 6:15that inbox. In nin you will do all the
  125. 6:18processing. We'll look into that in
  126. 6:19detail. And then data goes into
  127. 6:21Postgress and from Postgress you would
  128. 6:24pull the data into quadratic to do your
  129. 6:27analysis.
  130. 6:31So I'm assuming that using the link in
  131. 6:33the video description below, you have
  132. 6:36received all these files and you have
  133. 6:37sent two emails. one containing data for
  134. 6:40US, the other containing data for India
  135. 6:44into your personal inbox or whatever
  136. 6:47email id that you want to use for this
  137. 6:49project. Okay. And now we are going to
  138. 6:51set up N8N.
  139. 6:54In case if you have not used this
  140. 6:55before, this is an AI agentic workflow
  141. 6:59automation tool which is getting very
  142. 7:01popular nowadays. Go to n8.io.
  143. 7:05Sign in using whatever credentials. I
  144. 7:09have already signed in and you will get
  145. 7:1314 days free trial.
  146. 7:20So I'm on the homepage. So here when you
  147. 7:23come for the first time you will uh see
  148. 7:25little different UI. I mean all these
  149. 7:27things will still be there. So you're
  150. 7:29going to create a workflow here and in
  151. 7:32that workflow you will add a first step
  152. 7:35and this first step is to monitor
  153. 7:39your Gmail. So you click on Gmail on
  154. 7:43message received. So here whenever you
  155. 7:47receive a message into your Gmail
  156. 7:48account you want to trigger this
  157. 7:51automation workflow. These workflows can
  158. 7:53be triggered via different means. In our
  159. 7:56case, it is triggered whenever new email
  160. 7:59comes to our Gmail account. Now here I
  161. 8:02have already added my authentication.
  162. 8:04But essentially what you can do is
  163. 8:06create new credential and here sign in
  164. 8:09with Google. So you will say sign in
  165. 8:11with Google. You will provide all the
  166. 8:13credentials. It is pretty common sense
  167. 8:15folks. You should know how to do it.
  168. 8:17Okay? And if you don't just take help of
  169. 8:20chat GPT. So you will uh log to your
  170. 8:24Gmail credentials and after you have
  171. 8:27logged in you will get this thing okay
  172. 8:30Gmail account so I have configured that
  173. 8:33particular email id right this
  174. 8:35particular email id I have already
  175. 8:37configured it and then here
  176. 8:41I'm saying monitor this Gmail for every
  177. 8:44minute for incoming emails and here uh
  178. 8:49just uncheck this because we will need
  179. 8:51this option and in add filter you will
  180. 8:55say labels okay label label names or ids
  181. 9:00and I want to use my inbox so I'm
  182. 9:03monitoring my inbox essentially
  183. 9:06then search
  184. 9:09so in the subject you will say
  185. 9:12okay what is the subject look like so in
  186. 9:15the subject you will say daily sales so
  187. 9:18all these emails will have specific
  188. 9:20subject subject. So you have to identify
  189. 9:21that pattern. So I'm saying that if my
  190. 9:24subject contains daily sales. Okay. So I
  191. 9:28will say subject contain daily space
  192. 9:31sales then look at that subject and in
  193. 9:35the options you will say access the
  194. 9:38attachments. Okay. So once again uncheck
  195. 9:41this simplify only then you will see
  196. 9:43this particular options. Now I can say
  197. 9:46fetch test event and see it is able to
  198. 9:50fetch that particular file. So if you
  199. 9:52look at this particular email what it
  200. 9:54did is it went to this particular inbox
  201. 9:58and it pulled this particular email okay
  202. 10:02so you have two attachments okay 4.8 8
  203. 10:05KB 20 KB and when you look at it 4.921
  204. 10:10right so so almost same so fact
  205. 10:12aggregate India so this is the email for
  206. 10:14India so it it pulled the most latest
  207. 10:17email here so this is looking good in
  208. 10:19case if you want to view the file you
  209. 10:22can click on view and you should be good
  210. 10:24to go click on back to canvas button so
  211. 10:28this thing is good the next step here is
  212. 10:32to extract the data so we will say
  213. 10:35extract from file. So now we are pulling
  214. 10:38those files but we need to extract data
  215. 10:41in a JSON format. Okay. So we will say
  216. 10:45extract from CSV
  217. 10:47and here
  218. 10:49you will provide this field. So you are
  219. 10:51saying that we have two attachments. One
  220. 10:54is aggregate data, one is detailed order
  221. 10:56line data. So we want to firsth process
  222. 11:00this particular file which is your
  223. 11:02aggregate file. And here if you click on
  224. 11:04JSON
  225. 11:06you you see this if you look at JSON it
  226. 11:08is mapping this 128 items and it is
  227. 11:12pulling all these fields. All right. So
  228. 11:15this part looks good. Now if you just
  229. 11:18say test step it will actually show you
  230. 11:20these. Okay. So this you will be able to
  231. 11:22see when you click on test step. So
  232. 11:25that's it I think. So essentially you
  233. 11:29are converting your CSV data into JSON
  234. 11:31format through this step. The next step
  235. 11:34then is to uh get this data and ingest
  236. 11:38it into Postgress. Okay. So here
  237. 11:45click on Postgress
  238. 11:48and insert rows in table.
  239. 11:52So now you need to connect it to your
  240. 11:55Postgress account. I have already
  241. 11:57connected it with my posgress account
  242. 12:00but for you you will click on create new
  243. 12:02credentials and it will ask you for all
  244. 12:04these details. Now you need to use uh
  245. 12:08superbase. Okay. So superbase.com go to
  246. 12:11that website and create your login. You
  247. 12:13can create your free login. So I'm
  248. 12:15already logged in into this account.
  249. 12:18Superbase is a way to host your
  250. 12:20Postgress database on cloud. See you can
  251. 12:24run Postgress database on local machine
  252. 12:26but this allows you to run it on a cloud
  253. 12:29and Postgress just in case if you don't
  254. 12:31know is a relational database that also
  255. 12:34provides no SQL capabilities but here we
  256. 12:37are essentially using it as a relational
  257. 12:39database only. So create an account
  258. 12:42using I think Gmail or whatever again
  259. 12:44pretty pretty common sense uh thing that
  260. 12:47we are doing here and you will have some
  261. 12:50organization etc. Uh so create an
  262. 12:52organization if you have not created
  263. 12:54already and when you go here uh you need
  264. 12:57to create a project and by the way we
  265. 12:59are going to provide all the steps
  266. 13:02related to this in a PDF file. So once
  267. 13:05again check video description you will
  268. 13:07get a link through which you will be
  269. 13:09able to download all these files and one
  270. 13:11of the files will be to set up your
  271. 13:14posgress on superbase. Okay. So please
  272. 13:19follow those uh files we have given
  273. 13:22everything in detail. I have already set
  274. 13:24up my database because I don't want to
  275. 13:26waste uh time and I I don't want to make
  276. 13:29it like a very long tutorial. So I
  277. 13:32already uh set up my database and my
  278. 13:34database looks like this. Once again
  279. 13:36these these steps are provided in the
  280. 13:38video description. So check it out.
  281. 13:45Okay. So these are the tables that I
  282. 13:47created and you as you can see I have
  283. 13:50two fact tables and three dimension
  284. 13:53tables. Just in case if you don't know
  285. 13:56about fact and dimension table I have a
  286. 13:59video on YouTube this one star schema
  287. 14:01video you you can watch it but
  288. 14:04essentially fact table contains your
  289. 14:06transactions whereas dim table contains
  290. 14:09your dimensions such as customers you
  291. 14:11know the information that doesn't change
  292. 14:12too often customers products and all
  293. 14:15that but fact is more like a
  294. 14:17transactional data you you see it kind
  295. 14:19of changes and if you look at the data
  296. 14:23here we have a data till 56
  297. 14:26you know you can sort descending and we
  298. 14:29have data till 16 May right sort
  299. 14:32ascending let me see so order placement
  300. 14:36date sort descending 516 okay so I'm
  301. 14:41assuming you have followed all the
  302. 14:43instructions from that PDF file that we
  303. 14:45are attaching and your database is ready
  304. 14:48now to get the connection string you
  305. 14:50will go here okay and you will look into
  306. 14:53your session session puller and you will
  307. 14:55use all this information host port etc
  308. 14:58and you will enter that information
  309. 15:00here. So for example my host will be you
  310. 15:04copy from here and you you know this is
  311. 15:08my host my database is posgress my user
  312. 15:12is
  313. 15:14this one so you will put user here you
  314. 15:17will use the same password that you use
  315. 15:19to login into superbase okay so let's
  316. 15:22say you have put the password uh port is
  317. 15:245432
  318. 15:26and that's it and when you set save it
  319. 15:29will create a connection into your
  320. 15:31postgrace database. I have already
  321. 15:34created it so I'm not creating it again.
  322. 15:37And once you have created it, you will
  323. 15:39see this option you know postgrace
  324. 15:40account. So I'm just clicking that and
  325. 15:44this is the insert operation and you
  326. 15:48want to insert data to your fact orders
  327. 15:51table. See we are looking at the first
  328. 15:53attachment. Okay. So our first
  329. 15:55attachment is this fact aggregate table.
  330. 15:58We are ingesting this data into fact
  331. 16:02orders aggregate and here you need to do
  332. 16:07uh this mapping. Okay. So order ID goes
  333. 16:09to order ID. Customer ID goes here.
  334. 16:13Order placement date goes here. And here
  335. 16:16I want to format this date differently.
  336. 16:18So here it is month, year and um
  337. 16:22actually date, month and year. But what
  338. 16:25I want to do here is I want to say
  339. 16:28convert it to date time
  340. 16:41when I was doing this two date time
  341. 16:44initially I was getting an error. See if
  342. 16:46you do
  343. 16:47just the
  344. 16:49two date time you get error that you
  345. 16:52cannot convert to luxen date time. So
  346. 16:56the format for the date that we have in
  347. 16:59our email. So let's look at that. So
  348. 17:02here the format is ddmm and then year
  349. 17:05and looks like that luxen I think it's a
  350. 17:07javascript library is not able to
  351. 17:09understand that. So we need to tell it
  352. 17:12okay what format is this? And if you
  353. 17:15look at the documentation of this see if
  354. 17:19you look at I think two data yeah here
  355. 17:24in the bracket you can specify the
  356. 17:25format. So they have this documentation
  357. 17:28which says you can specify this
  358. 17:30particular format where you can say ddmm
  359. 17:32y. So I'm going to use this and I'm
  360. 17:36going to specify that format. After that
  361. 17:39it is parsing that this particular date
  362. 17:41into datetime object and then you are
  363. 17:44saying format.
  364. 17:46So I want to essentially convert this
  365. 17:49into this format where you have year
  366. 17:52first then month. This is like iOS
  367. 17:54standard format. So that way you know uh
  368. 17:58the injection into postgrace is
  369. 18:00smoother. Okay. Okay. So sometimes you
  370. 18:01have to do all this date conversion,
  371. 18:03format conversion etc into your this
  372. 18:06this mapping that you are creating in N8
  373. 18:10and I already map on time info
  374. 18:14if and so on. Okay. So test the step.
  375. 18:18After testing the step when I go to my
  376. 18:21Postgress database I will see data for
  377. 18:2417th May. See 17th May. Previously it
  378. 18:27wasn't there. I had it till 16. So
  379. 18:30through this step it inserted that data
  380. 18:35from that file. Okay. So now what I can
  381. 18:40do is I can go back. I think this
  382. 18:44mapping looks good to me. I will just
  383. 18:48copy this because I might need this in
  384. 18:50the when I'm doing the mapping for the
  385. 18:52other file. Okay. So this one this flow
  386. 18:56is good enough. Now we will need to map
  387. 19:00the other file. So here this one I will
  388. 19:03rename and I will say extract from
  389. 19:06extract from file
  390. 19:10aggregate. Okay.
  391. 19:12And you need to now create another flow
  392. 19:16for the second file. Remember we have
  393. 19:17two files. So the second file is your
  394. 19:21order line items. So here you will
  395. 19:26specify your second file here. Okay.
  396. 19:30And the test tab. So it is pulling the
  397. 19:33data from the second file. See you can
  398. 19:35see all these fields. Go back to canvas.
  399. 19:39And here add your postgress. Same folks
  400. 19:43you are just repeating the same steps
  401. 19:46here.
  402. 19:48And
  403. 19:49here you are specifying your order line
  404. 19:52table line item table.
  405. 19:56And then just see map these fields.
  406. 20:04And for order placement date you will do
  407. 20:06the same thing to date time and in this
  408. 20:10two date time you will specify
  409. 20:15this particular format. Okay. So let me
  410. 20:17just copy paste. This is the format
  411. 20:21I am using
  412. 20:24and then I'm formatting it to this
  413. 20:26format ISO format Y
  414. 20:29mm DD. Okay. Then customer ID. So make
  415. 20:33sure you're mapping
  416. 20:36all these fields accurately. I mean
  417. 20:40sometimes people might drop one field
  418. 20:41into another. So if you make that
  419. 20:43mistake, of course it's not going to be
  420. 20:45good. So just map it.
  421. 20:55As you can see all the fields are
  422. 20:57mapped. The only format conversion is
  423. 21:00happening with order placement date.
  424. 21:01Other fields are okay. And I will click
  425. 21:04on test step here.
  426. 21:07Input invalid for agreed delivery date.
  427. 21:11So looks like we will just use the same
  428. 21:15format for these dates because
  429. 21:19see it had a date 35 2025. So maybe it
  430. 21:23got it wrong over there.
  431. 21:25So we are converting it to standard DDMM
  432. 21:30Y format first and then converting it to
  433. 21:32our standard ISO format. So let's do it
  434. 21:35for all the dates. Okay. Do we have any
  435. 21:37other dates? So on time is good. Okay.
  436. 21:40dates are being taken care of. Okay,
  437. 21:43let's test the step now.
  438. 21:50I was getting all those errors because
  439. 21:52there was some format error with my
  440. 21:55Excel file and I have fixed those. Okay.
  441. 21:58So, if I pull my files here, CSV files,
  442. 22:02then these date formats were previously
  443. 22:05inconsistent. So, I was getting it. You
  444. 22:06will not get these errors because I have
  445. 22:09fixed those issues. Okay. So if you're
  446. 22:11using this new files which we are going
  447. 22:12to attach down below, you're not going
  448. 22:15to get those errors. So now u but I
  449. 22:19think it's still a good idea to convert
  450. 22:21it to standard
  451. 22:23ISO format. Okay. And then do the format
  452. 22:26conversation to conversion to whatever
  453. 22:29format you need. So we are going to do
  454. 22:30it for all the dates here. And once you
  455. 22:33are ready, you can taste this particular
  456. 22:37step. So let's test this.
  457. 22:41All right, it executed it fine. If you
  458. 22:44go to your database and if you look at
  459. 22:47your order line items, see it is still
  460. 22:50refreshing. Right now it's showing 16.
  461. 22:52Now it changed. You see it changed. So
  462. 22:54it inserted all the records from 17th
  463. 22:56May. But I I previously deleted the
  464. 23:00records from
  465. 23:02aggregate as well. Okay. So I I still
  466. 23:04don't have aggregate record because I
  467. 23:05was fixing those errors. So you don't
  468. 23:07have to run these steps but I'm going to
  469. 23:10u just execute this one
  470. 23:14so that I see the 17th data in both of
  471. 23:17it. Okay. So here
  472. 23:20so essentially you want to go to a stage
  473. 23:23where you see the data for 17th for both
  474. 23:26fact order online and fact orders
  475. 23:29aggregate.
  476. 23:31Now just in case if you're facing errors
  477. 23:33and if you're running it again and again
  478. 23:35and if you want to delete the data you
  479. 23:36can use this query you can you know if
  480. 23:39you want to delete the data let's say
  481. 23:41there is some problem you can use this
  482. 23:43query you can say delete from fact order
  483. 23:45line where order placement date greater
  484. 23:48than this so that way you are deleting
  485. 23:50that 17th May data uh you you need to do
  486. 23:54it for both the tables okay so one for
  487. 23:56fact order online and the other one for
  488. 23:59aggregate table. Uh so so let me do it
  489. 24:02so that you know. So let me delete these
  490. 24:05records. Okay. So delete all the records
  491. 24:07for
  492. 24:09aggregate table first. So these records
  493. 24:11are deleted and then delete it for
  494. 24:15the um
  495. 24:19other table. Which other table we have?
  496. 24:22Order online. Right?
  497. 24:24So see I deleted these records. And when
  498. 24:27I go to postgrace
  499. 24:30uh the table view
  500. 24:32so it is refreshing you see down below
  501. 24:34it is still refreshing but when it is
  502. 24:37refreshed you see data only till 16 same
  503. 24:40here you need to have sorting by the way
  504. 24:42okay don't forget that that's uh see
  505. 24:44it's still refreshing so let me just
  506. 24:46yeah 16 see and it is sorted based on
  507. 24:50descending order so to ingest the data
  508. 24:53now I will run the entire workflow so
  509. 24:56after deleting it. When I go here and
  510. 24:59when I say test workflow, it will taste
  511. 25:02both the workflows. See first that first
  512. 25:05file, second one is second file. And
  513. 25:07when I come here now and refresh, I
  514. 25:12should see data for 17th. See 17th May.
  515. 25:16Same for the second table. When I
  516. 25:18refresh, I will see data for 17th May.
  517. 25:22All right. Our data injection part is
  518. 25:24over. Now one additional thing I will do
  519. 25:26is also ingest the file for USA.
  520. 25:30Remember so far we ingested data only
  521. 25:32for India. You are given all these
  522. 25:35files. So you will find two files for
  523. 25:37USA. And I'm going to compose an email.
  524. 25:41I'll just send it to myself and just say
  525. 25:44daily
  526. 25:46sales USA
  527. 25:5117th May. And I will just attach these
  528. 25:55files. So attach both the files for USA
  529. 26:00and send it. So when you send it, see I
  530. 26:02see the email here.
  531. 26:04But my workflow has not triggered yet
  532. 26:07because
  533. 26:09it is inactive. You see the workflow. I
  534. 26:12gave it a name postgris data injection.
  535. 26:14It is still inactive. If it was active,
  536. 26:17it will be monitoring my email and it
  537. 26:20will be sending it. But you can kick it
  538. 26:23off manually as well. So I'll click on
  539. 26:27test workflow
  540. 26:29and see here it inserted 57 items and
  541. 26:34here 109 items.
  542. 26:37So let's verify if that is correct. So
  543. 26:40USA
  544. 26:42aggregate data see 57 item because there
  545. 26:44is a header. So 57 items total. So that
  546. 26:47is correct. And then order line for USA
  547. 26:51is
  548. 26:54109. There is a header. So 109 rows in
  549. 26:57total. 109. So it inserted that data.
  550. 27:03And here
  551. 27:07I think here even if you refresh it will
  552. 27:09still show 17. So you have to look into
  553. 27:11the order ID and stuff like that. But
  554. 27:14let's see order line as well. So both of
  555. 27:17these tables are updated with USA data.
  556. 27:23Let's now analyze this data in
  557. 27:25quadratic. Quadratichq.com is a website
  558. 27:29you will go here. You can chat with your
  559. 27:32data and get insights all using AI.
  560. 27:36Click on open quadratic. So you will
  561. 27:38come here. You're going to get some free
  562. 27:40credits by the way. So don't worry,
  563. 27:42you'll have enough credits to run this
  564. 27:44project. And then here you will click on
  565. 27:48new file. Then let's connect this to
  566. 27:51posgress. So here uh just click on
  567. 27:55posgress. Okay. And connection name you
  568. 27:58can say anything right like atlick m and
  569. 28:02then provide that same host name.
  570. 28:05You see like when we were here in the
  571. 28:08session pooler you need to provide this
  572. 28:10host port database user or whatever
  573. 28:14right? All these credentials you can
  574. 28:16provide here. Password will be the
  575. 28:18password for your superbase
  576. 28:20and once all of that is done you will
  577. 28:23see this kind of entry postgress entry.
  578. 28:26So you click on it and you will see this
  579. 28:29connection. See it is pulling all these
  580. 28:30tables here dim customers etc. You can
  581. 28:33also write queries by the way. You can
  582. 28:35write select queries to fetch this data.
  583. 28:39So let's pull all this data for dim and
  584. 28:42fact tables in our quadratic
  585. 28:44spreadsheet. So the first one is going
  586. 28:47to be dim customers. So let me name this
  587. 28:50sheet dim customers
  588. 28:53and then you can click on this dim
  589. 28:55customer here query selected table and
  590. 28:58see it will pull all that data. Isn't
  591. 29:01this cool? So we have only 37 customers
  592. 29:05and it is running this query with a
  593. 29:07limit. Ideally, you should run this
  594. 29:09query without limit. But in our case,
  595. 29:11it's okay because the number of rows are
  596. 29:1337. They're less than 100 anyway. Then
  597. 29:16you will create the second one which is
  598. 29:21dim
  599. 29:22products and check dim products
  600. 29:27query select table. Okay. And run it.
  601. 29:31Right now I think there is some kind of
  602. 29:33issue due to which I'm not able to do
  603. 29:35it. So what I usually do is and we have
  604. 29:38passed this feedback to quadratic team
  605. 29:40they will fix it okay it's just a
  606. 29:42temporary thing but just in case if
  607. 29:44you're facing this problem click on this
  608. 29:46database icon once again click here then
  609. 29:50come here then click on query and it
  610. 29:54will pull the data. Third one is dim
  611. 29:57target
  612. 29:59orders
  613. 30:01and once again click here click on this
  614. 30:05query selected table now here I have
  615. 30:09only 20 records so I'm good then fact
  616. 30:15order online back.
  617. 30:32Okay, in dim target orders, I think I
  618. 30:34made a mistake. I'm just saying this
  619. 30:37one. Actually, I should be pulling data
  620. 30:38from a different table. So, let me just
  621. 30:41delete this and
  622. 30:45dim target orders. Right. So dim target
  623. 30:47order should be this
  624. 30:49query. Okay, query is not working. So
  625. 30:52let me just go here
  626. 30:54again. Say query
  627. 30:57and here only 37. So I'm good. The next
  628. 31:01one is fact order
  629. 31:06fact order line. Okay, fact order lines
  630. 31:09which is this table.
  631. 31:12And for that particular table once again
  632. 31:16connect to posgress
  633. 31:19and select that fact order line and
  634. 31:22query. Now when I query I will pull only
  635. 31:24100 records but there are more actually.
  636. 31:27So what you should do is uh remove this
  637. 31:29limit clause and execute the query
  638. 31:32without limit so that you can pull all
  639. 31:36the orders. See how many orders do I
  640. 31:39have? See you have so many orders. Okay,
  641. 31:41it's definitely more than 100. So you're
  642. 31:43going to pull that and same way setup
  643. 31:45fact orders aggregate.
  644. 31:56See, so I got these many records. So
  645. 31:58make sure you are running your queries
  646. 32:01without the limit clause. And I realized
  647. 32:04that even dim customer table was also
  648. 32:06mapped incorrectly. Maybe I selected the
  649. 32:09wrong one. So for dim customer make sure
  650. 32:11you are selecting the right table. Okay
  651. 32:13that's very important. Okay. So see you
  652. 32:16are in dim customer uh sheet dim
  653. 32:19customer query and that's it. Right. You
  654. 32:21can move the table here. So we are all
  655. 32:24set. Whenever you are doing this kind of
  656. 32:25analysis you almost always need a date
  657. 32:28table. A table which has the required
  658. 32:30dates with extra columns for months year
  659. 32:34etc. If you have worked as a data
  660. 32:35analyst you will know the importance of
  661. 32:37this dim date table. Okay. So I'm going
  662. 32:40to create
  663. 32:41this dim date table. And the good news
  664. 32:44is that with AI you can just type a
  665. 32:47prompt here and create that table with
  666. 32:49all the required prompt.
  667. 32:56Okay. So that it's very easy. So I'm
  668. 32:58going to copy paste this prompt for
  669. 33:00creating the date table. and make sure
  670. 33:04when you're running this prompt you have
  671. 33:07this as a active sheet. Let's say if you
  672. 33:10select this then you see it will insert
  673. 33:12a table in that sheet. You don't want
  674. 33:14that. Okay. So click here. So that way
  675. 33:18you see dim date that is your active
  676. 33:19sheet where you're working. This is your
  677. 33:22uh cursor location and you are saying
  678. 33:24that create a date table that has dates
  679. 33:27from this March 1st to March 31st.
  680. 33:32And when you do this, it will use AI to
  681. 33:36first write Python code and it will then
  682. 33:39execute that Python code. And you can
  683. 33:42see the output. See date table. It's so
  684. 33:44awesome. So you have dates from 1st
  685. 33:48March to whatever. And you have separate
  686. 33:51columns for year, month, day. All of
  687. 33:54these are useful when we will do the
  688. 33:56analysis later on. You can also see the
  689. 33:58code. So if you click on this icon you
  690. 34:01can see the code and if you know Python
  691. 34:04coding if you want to let's say change
  692. 34:07certain things you can modify the code
  693. 34:09manually or you can chat here that okay
  694. 34:12do this particular change at this line
  695. 34:14or change the format of this column and
  696. 34:16so on. The next step for our analysis
  697. 34:19will be to create the exchange rates
  698. 34:23sheet. Okay. So I'm going to create
  699. 34:27exchange
  700. 34:29rates sheet and this sheet will uh
  701. 34:33contain the exchange rate conversion
  702. 34:36between USD and INR. Okay. And that
  703. 34:38conversion is required because later on
  704. 34:41we need uh this for performing our
  705. 34:44analysis. See if you want to say okay
  706. 34:46what are my sales number in USD and what
  707. 34:49are my sales number in INR then you need
  708. 34:52some kind of conversion right because
  709. 34:54our business is in both the location
  710. 34:56India and US and you notice that we have
  711. 34:58sales number coming in for both the
  712. 35:01countries in our product table also see
  713. 35:04we have INR and USD price so you know
  714. 35:08this conversion the exchange rate table
  715. 35:11that we have it can be useful now how do
  716. 35:13you get the exchange rates. Well, we are
  717. 35:17going to use this website called
  718. 35:19openexchange rates.org to get the actual
  719. 35:22conversion rate. Okay, we are not going
  720. 35:24to use some dummy one. So, you create an
  721. 35:27account using your Gmail or whatever
  722. 35:30whatever way you want to create account
  723. 35:31up to you. And when you go to your
  724. 35:33dashboard, you will create this app ID.
  725. 35:37Okay? So you will create this app ID
  726. 35:40which is sort of like an API key and you
  727. 35:43will use this in that quadratic. Okay.
  728. 35:45So make sure you have the app ID copied
  729. 35:48somewhere. So you copy it and then you
  730. 35:51are going to use a prompt. So once again
  731. 35:54the prompt that we have given you. This
  732. 35:56is the prompt. See create an exchange
  733. 36:00rate table from this date to that date
  734. 36:03and use this open exchange rate API.
  735. 36:07Okay. So you're telling that your LLM to
  736. 36:10kind of create a code for it. So let me
  737. 36:13just copy paste here.
  738. 36:16Copy paste here and make sure once again
  739. 36:19exchange rate is the active sheet. I
  740. 36:22will supply here. By the way this app ID
  741. 36:24you see this app ID here in the prompt.
  742. 36:27You will use your own app ID. Okay. This
  743. 36:30app ID we are going to delete. So it
  744. 36:31will not be valid. So it will not work.
  745. 36:33So replace this app id with your app id
  746. 36:36that you have created on open exchange
  747. 36:39rates.org
  748. 36:41and after that you will write uh you
  749. 36:45will give this prompt it will generate a
  750. 36:47python code. So let's look at the python
  751. 36:49code here.
  752. 36:51You see this is the python code that it
  753. 36:54has written and it is executing it right
  754. 36:56now. All right. How cool is this? I see
  755. 36:59the exchange rate table. This is USD to
  756. 37:03INR rate. Okay. And if you want to make
  757. 37:06any changes in Python code, feel free. I
  758. 37:09know Python coding. So I can make a
  759. 37:12change such as the exchange rate. I need
  760. 37:14it only till four decimal precision.
  761. 37:18Okay. So I can change the code manually.
  762. 37:21But let's say if you don't know Python
  763. 37:23coding, you can ask here that I want the
  764. 37:30exchange
  765. 37:32rate
  766. 37:34to be in four decimal precision and it
  767. 37:39will update that code and it will rerun
  768. 37:42it again. I still believe having coding
  769. 37:45skills is useful because sometimes you
  770. 37:48get give this prompt and let's say see
  771. 37:51it made some code changes. Okay, see it
  772. 37:53is rounding it to four decimal. I'm
  773. 37:55accepting but I know coding that's why I
  774. 37:58can say okay it's a correct change. If
  775. 37:59you don't know coding at all sometimes
  776. 38:01you know you might get bad result. So I
  777. 38:04believe having coding skills can still
  778. 38:07help you although we are doing automated
  779. 38:09coding through uh this AI but anyways
  780. 38:13this will rerun it again and you will
  781. 38:15see the new result. Okay you see these
  782. 38:18numbers are in now four decimal
  783. 38:20precision. So exchange rate table is
  784. 38:23created. It's looking good. Now let's
  785. 38:25move on to the next step which is doing
  786. 38:28data cleaning and summarizing required
  787. 38:30data in one table. We are going to
  788. 38:32provide you this document. So you'll be
  789. 38:34able to copy paste this entire prompt
  790. 38:37which is marked in yellow. So let me
  791. 38:39copy paste this entire prompt here
  792. 38:43and we will run this prompt in a new
  793. 38:46sheet. We'll call it fact summary. So in
  794. 38:50fact summary
  795. 38:52let's run this prompt. Okay. And when
  796. 38:55you run this prompt uh after some time
  797. 38:58it will create uh this particular merge
  798. 39:01table. Now what exactly was this prompt?
  799. 39:05So if you have done data analysis
  800. 39:07you know that you need to merge all this
  801. 39:10dim and fact table into one uh
  802. 39:13denormalized table which contains all
  803. 39:15the columns. Okay. So we are saying that
  804. 39:18load data from fact table this dim table
  805. 39:21exchange rate table and then clean the
  806. 39:24data. Okay. So you're cleaning uh
  807. 39:27product see converting product ID and
  808. 39:29customer ID to numeric because they were
  809. 39:31string then uh removing wide spaces
  810. 39:35because usually in the real life data
  811. 39:37sets you will find all these white
  812. 39:38spaces null ids you are converting ids
  813. 39:42to integers dates to date time. So if
  814. 39:44you have worked in data analysis, these
  815. 39:46are the typical steps that you follow
  816. 39:50okay like cleaning data then merging the
  817. 39:53table and then you will say okay merge
  818. 39:55these tables using this column okay
  819. 39:57product ID column customer ID column and
  820. 40:00so on. Then you will also calculate the
  821. 40:03total amount. See you are doing the
  822. 40:04currency remember we did that currency
  823. 40:07conversion USD to INR rate whatever. So
  824. 40:10you are doing that uh conversion and
  825. 40:13then you are producing this uh final
  826. 40:15output and you will see this kind of
  827. 40:17table at the end. All right, you can do
  828. 40:19some uh testing. You can look at some
  829. 40:21couple of rows and make sure your data
  830. 40:23is correct. But the way I'm seeing it
  831. 40:27right now is we have one merged table.
  832. 40:30Not only merged table but we have done
  833. 40:32cleaning as well. And in the code that
  834. 40:35was generated um if you look at it see
  835. 40:38it is using data frame and it is doing
  836. 40:41some internal cleaning.
  837. 40:44You see if you know pandas and python
  838. 40:47see it is doing conversion to date time
  839. 40:50then it is merging it is creating some
  840. 40:53calculated columns and finally it is
  841. 40:55creating this uh final fact summary
  842. 40:58sheet.
  843. 41:01All right, we will now begin our data
  844. 41:03analysis session. Here with me, I have
  845. 41:06Hamand Vial who has worked as a data
  846. 41:08analytics manager in Europe for more
  847. 41:11than 7 years working on multiple large
  848. 41:14scale data analytics projects. He's also
  849. 41:17a supply chain domain experts. So the
  850. 41:20goal here is to teach you not only data
  851. 41:23analytics using AI but also teach you
  852. 41:25important supply chain concepts. Over to
  853. 41:28you Haman. Thank you D. That's very
  854. 41:30exciting to be here to work on a supply
  855. 41:32chain project and I have seen the data
  856. 41:34that we have created from quadratic and
  857. 41:36we have pulled the data from superbase
  858. 41:38postgrade and the next step is to create
  859. 41:41supply chain KPIs. Correct?
  860. 41:43Yes.
  861. 41:45So before we create the KPIs as a data
  862. 41:48analyst the first thing to do is to
  863. 41:50validate the data that you got on this
  864. 41:52quadratic spreadsheet with what we got
  865. 41:54in the superbase.
  866. 41:56So let's do that step first. So I'm
  867. 41:58opening this sheet. Okay, I'm going to
  868. 42:00this dim customers table. So here we
  869. 42:03have 37
  870. 42:06which means 35 rows because the first
  871. 42:08two rows are headers. And let me go to
  872. 42:10the superbase postgrade database.
  873. 42:14So here we have 35 that's exactly
  874. 42:16matching. So we are good. And then we do
  875. 42:20the same thing for products. We have 18
  876. 42:22here. We have 18 here as well. That's
  877. 42:24good. And then we have targets. Target
  878. 42:26orders. We have 35 here and 35 here as
  879. 42:29well. That's also good. So now let's go
  880. 42:31to the fact order line. So in here the
  881. 42:34sheet we have around 23 554 and we have
  882. 42:3925,538.
  883. 42:40Okay, that's not matching. So with
  884. 42:42respect to orders aggregate we have
  885. 42:4513652 here in the database that we have
  886. 42:49got we have 13314 that's not matching as
  887. 42:52well. And if you see further, okay, it's
  888. 42:57adding this 13652 rows. It's it's it's
  889. 43:00present there. It's simply
  890. 43:03showing it as null. So I investigated
  891. 43:05further with this. It seems there is
  892. 43:07some, you know, intermittent delay in
  893. 43:09fetching the data. I have reported this
  894. 43:11to the coordinating team. They are
  895. 43:12working on it. But I think we should
  896. 43:14consider this as actual data. Whatever
  897. 43:17we see in this table as actual data and
  898. 43:19proceed with our analysis. But folks
  899. 43:21when you're watching this please know
  900. 43:23that there is this gap
  901. 43:24and the idea of this video is to teach
  902. 43:27you this evolving
  903. 43:29data analytics tools through AI. So you
  904. 43:33want to understand this uh AI mindset of
  905. 43:37doing data analytics. So even if the
  906. 43:40there is some issue with the data it's
  907. 43:42okay these are intermittent issues which
  908. 43:44will get fixed. The purpose is to learn
  909. 43:47and evolve along with these tools. All
  910. 43:50right, let's begin looking into the
  911. 43:52KPIs.
  912. 43:55Okay, these are the seven KPIs we are
  913. 43:57going to create. We could see this on
  914. 43:59the screen and I tried something very
  915. 44:02interesting with quadratic. I just
  916. 44:04simply pasted this KPIs there in the
  917. 44:06sheet without even explaining how to
  918. 44:08calculate it. So if it has to calculate
  919. 44:11it correctly, it has to go to the
  920. 44:12internet, understand this metrics and
  921. 44:14then create the results. Let's see if
  922. 44:16that works.
  923. 44:17I've copied this prompt.
  924. 44:20So all these prompts will be given to
  925. 44:22people so they can replicate the same.
  926. 44:24And we went to the quadratic sheet.
  927. 44:30Then I just simply pasted this prompt.
  928. 44:34So I'm going to create a new sheet for
  929. 44:36this. I'm going to call it like APIs.
  930. 44:43Yeah. Let's see if that works.
  931. 44:48It's very interesting, right? It fetched
  932. 44:50all these results. But how do you know
  933. 44:52if this is correct? You need to know two
  934. 44:54things for this. First, you need to know
  935. 44:55the data analysis because you can open
  936. 44:57this Python code and check really if
  937. 45:00this thing is
  938. 45:02if this code is making sense or not.
  939. 45:04Even if this code is making sense, you
  940. 45:06need to have some domain knowledge to
  941. 45:08understand if the calculation is right
  942. 45:10or not.
  943. 45:10Yeah. So, can you explain what these
  944. 45:12KPIs are? And can you increase the font
  945. 45:14size so that I can see better and then
  946. 45:16you explain what exactly is the meaning
  947. 45:19of these KPIs?
  948. 45:20I'm going to explain this with a very
  949. 45:21simple example so that everyone can
  950. 45:23understand and having this kind of
  951. 45:25domain knowledge is very important you
  952. 45:27know especially if you're targeting your
  953. 45:28career in operations and supply chain.
  954. 45:30So I've created this very simple table.
  955. 45:32Just imagine you made an order in
  956. 45:34Amazon, right? You made it on 19th of
  957. 45:37May and you made the first order. So it
  958. 45:39is called as order number one. And you
  959. 45:41ordered keyboards and you ordered five
  960. 45:43keyboards, right? The next day you made
  961. 45:47an order but this time you ordered two
  962. 45:49items which are keyboards and mouse. So
  963. 45:52now tell me based on this table
  964. 45:56how many orders are there?
  965. 45:58There are two orders right? want order
  966. 46:00one and two.
  967. 46:01Yes, there are only two orders. On first
  968. 46:03day you made only one order. Second day
  969. 46:05also you made only one order. So there
  970. 46:07are two orders, right? So that's two.
  971. 46:10And how many lines are there?
  972. 46:12Three if you think about it. Three.
  973. 46:15Yes. So that's exactly the difference
  974. 46:18between orders and order lines. Order
  975. 46:20lines will always be more. Orders are
  976. 46:22nothing but whenever you place an order,
  977. 46:24it it will get an order ID and that's an
  978. 46:26order. In each of this order you might
  979. 46:28be placing multiple items. So those will
  980. 46:31create order lines. Okay. So now let's
  981. 46:34understand what is line fill rate and
  982. 46:36volume fill rate. Okay. So we clearly
  983. 46:39understood what is order and order
  984. 46:40lines. Now with the same table let's
  985. 46:43just expand it. Right? This is the
  986. 46:45quantity order and this is the quantity
  987. 46:47delivered.
  988. 46:49So now tell me is this order delivered
  989. 46:51in full or not?
  990. 46:53Yes, because I ordered five and it was
  991. 46:55delivered five.
  992. 46:57So instead of writing yes, let's do
  993. 46:58binary. Let's write one. If the order is
  994. 47:00delivered in full, let's write one. If
  995. 47:02not, let's write zero. Okay. And tell me
  996. 47:06for the second line,
  997. 47:07no.
  998. 47:07This is in full or not? No.
  999. 47:09No,
  1000. 47:09it will be zero. And for the third line,
  1001. 47:12one.
  1002. 47:13This is exactly how it is written in a
  1003. 47:14typical supply chain table as well.
  1004. 47:16Okay.
  1005. 47:18So we have total three lines, right?
  1006. 47:20Line one, line two, line three. Out of
  1007. 47:23these three lines, how many lines we
  1008. 47:25delivered successfully?
  1009. 47:27Two.
  1010. 47:28Two. Okay. Because one and two, there
  1011. 47:31are two. And uh so what will be the line
  1012. 47:35fill rate now? Can you make a guess?
  1013. 47:36It is 2x3.
  1014. 47:38Exactly. So this is line fill rate
  1015. 47:40percentage. It is 2x3 because
  1016. 47:44you have to find a ratio of total lines
  1017. 47:48you've delivered which is two divided by
  1018. 47:52total lines order
  1019. 47:54which is three. So your line fill rate
  1020. 47:56is 66.67%age.
  1021. 47:59So now when it comes to volume fill rate
  1022. 48:01let me make it.
  1023. 48:07Can you make a guess what could be a
  1024. 48:09volume fill rate?
  1025. 48:12M
  1026. 48:15for volume you have to take into account
  1027. 48:17the quantity
  1028. 48:19exactly. So here let's take a sum.
  1029. 48:23So what is the sum of quantity ordered?
  1030. 48:26Right? It's 17. And what is the sum of
  1031. 48:29quantity delivered? It's 17.
  1032. 48:31So the volume fill rate is nothing but
  1033. 48:33the ratio of quantity delivered to the
  1034. 48:35quantity ordered. You just take this
  1035. 48:38number and divide it by this number.
  1036. 48:43So it's 85%age.
  1037. 48:45So that's the volume fill rate. And in
  1038. 48:47supply chain line fill rate and volume
  1039. 48:49fill rate is a very important metric for
  1040. 48:52supply planners, supply planners and uh
  1041. 48:56supply managers and production managers
  1042. 48:59because for them it's very important to
  1043. 49:01know how many lines were ordered and how
  1044. 49:04much they managed to deliver. So this is
  1045. 49:06how the performance is evaluated.
  1046. 49:09And this volume fill rate is also very
  1047. 49:11important for sales people. It's
  1048. 49:13important for supply people but also
  1049. 49:15very important for sales people. When
  1050. 49:16they're having a negotiation or some
  1051. 49:18kind of discussion with the customers,
  1052. 49:20they will say, "Hey, last year you
  1053. 49:22ordered uh 10 million quantities. We
  1054. 49:25delivered 9.98 million. So we we made a
  1055. 49:28you know we almost fulfilled all your
  1056. 49:30orders." because this conversation is
  1057. 49:32directly proportionate to the best deal
  1058. 49:34they can get from the customers. So this
  1059. 49:36metric is very important. Okay, let's
  1060. 49:38move on to two other important metrics
  1061. 49:39which is on time and info.
  1062. 49:44If you expand this table to two more
  1063. 49:45columns, two more information which is
  1064. 49:47agreed delivery date and actual delivery
  1065. 49:49date. So can you now tell me if this
  1066. 49:52order is delivered on time?
  1067. 49:54Yes, because the both the dates are
  1068. 49:55matching.
  1069. 49:56Perfect. So it's one and for the second
  1070. 49:59row it's one as well. for the third R1
  1071. 50:01as well. Okay. So, how many orders were
  1072. 50:04delivered in full?
  1073. 50:05Delivered in full two. We we have
  1074. 50:07discussed that, right? So, two orders.
  1075. 50:08Actually, it is not two orders because
  1076. 50:10if you think about orders, this is where
  1077. 50:12most people make mistake.
  1078. 50:14They think about lines here. In full is
  1079. 50:16calculated at order level, not at the
  1080. 50:18line level.
  1081. 50:19Oh, only one order because order one was
  1082. 50:22delivered full but order two was not
  1083. 50:24delivered full. Was not delivered. Good
  1084. 50:26point. In terms of on-time orders,
  1085. 50:30on-time orders were two. Both the orders
  1086. 50:33were delivered on time. Okay.
  1087. 50:36So this on-time orders it is used by can
  1088. 50:38you guess who uses it in the supply
  1089. 50:40chain field? So there are different
  1090. 50:42supply chain departments.
  1091. 50:44No, I I don't know.
  1092. 50:46Okay. So it is used by warehouse and
  1093. 50:48distribution people. So these are the
  1094. 50:50people who are in charge for delivering
  1095. 50:53the order on time. So you know all the
  1096. 50:56shipments all those trucks going on. So
  1097. 50:58this is managed by the warehouse and
  1098. 51:00distribution people. For them this
  1099. 51:01metric is very important. It's called
  1100. 51:03warehouse and distribution. And this
  1101. 51:06info is again used by supply
  1102. 51:09managers more at regional level. So they
  1103. 51:12want to see this number at a regional
  1104. 51:13level. Okay.
  1105. 51:15Mhm.
  1106. 51:16So now we are going to calculate the
  1107. 51:17most important metric which is on time
  1108. 51:19in full percentage. In supply chain
  1109. 51:21terms it is called as. What if is
  1110. 51:24something very very commonly used metric
  1111. 51:26and for this you can see the data is
  1112. 51:30consolidated at the order level not at
  1113. 51:32the item level. So you see we have three
  1114. 51:34lines here but we here we have only two
  1115. 51:36lines because it's at the order level
  1116. 51:38and you can see the values are also
  1117. 51:39consolidated here for the second order
  1118. 51:41the total quantity is 15 and total
  1119. 51:43delivered is 12. You can see the same
  1120. 51:45numbers here 15 and 12. So at this level
  1121. 51:50this order is not delivered in full but
  1122. 51:52it is delivered on time. So now tell me
  1123. 51:54if this order is delivered both on time
  1124. 51:56and in full.
  1125. 51:58Yes. It's a end condition between E and
  1126. 52:00H column.
  1127. 52:02Yeah. Then it's one. Tell me for this
  1128. 52:05this one is zero.
  1129. 52:06Yeah.
  1130. 52:08So I'll tell you a very interesting
  1131. 52:09point. For one particular order there
  1132. 52:11might be 200 lines. A customer might
  1133. 52:14place 200 items in one particular order.
  1134. 52:16Let's say they delivered all the 199
  1135. 52:18items in full but one line they did not
  1136. 52:21deliver in full. Even they miss one
  1137. 52:23quantity. That order will miss if
  1138. 52:26[Music]
  1139. 52:28it's it's a very harsh metric. It is it
  1140. 52:30is super super harsh. Sometimes the
  1141. 52:32order might have like 200 300 lines and
  1142. 52:34even if they miss one line that order is
  1143. 52:36failed. But that's how it's it's
  1144. 52:38calculated in supply chain and uh so
  1145. 52:41let's calculate the in full percentage.
  1146. 52:42So it's very uh you know very easy to
  1147. 52:44calculate. So now we know only one order
  1148. 52:47is delivered in full. So it's nothing
  1149. 52:49but 1 divided by this value two orders.
  1150. 52:54So it's 50%.
  1151. 53:01And here total on-time orders are two
  1152. 53:04and the total orders are two.
  1153. 53:07So it's 100%. This is super rare in in
  1154. 53:10in the real supply chain world, but for
  1155. 53:12this example, yes, this is possible. and
  1156. 53:15on time and inflow. So this is nothing
  1157. 53:18but how many orders we got both on time
  1158. 53:20and info only one right out of two
  1159. 53:23orders
  1160. 53:28it's also 50%.
  1161. 53:37So this on time and in full percentage
  1162. 53:39is normally used by supply chain
  1163. 53:41directors or supply chain VPs. So this
  1164. 53:44is the metric that they will focus on.
  1165. 53:46They will not focus on any other metric.
  1166. 53:48So this on-time and infill percentage is
  1167. 53:51also called as reliability.
  1168. 53:54Reliability is also a very important you
  1169. 53:56know term in supply chain. So if
  1170. 53:58somebody's asking what is the
  1171. 53:59reliability? If you say 85%age which
  1172. 54:01means 85%age of the times you will
  1173. 54:04deliver the order in full and on time.
  1174. 54:07So the customer will ask you what what
  1175. 54:10is the reliability I can have? If you
  1176. 54:12say 90%age that is really good which
  1177. 54:14means out of thousand orders they place
  1178. 54:16you are sure to make that 90 90% of the
  1179. 54:20times the orders will be always
  1180. 54:21delivered on time and in full.
  1181. 54:24So based on this thing the service level
  1182. 54:26agreements are made and the contracts
  1183. 54:27are dealt and even the you know there
  1184. 54:30are a lot of commercials involved in it.
  1185. 54:32All these things are based on this. So
  1186. 54:34this is also the point where the supply
  1187. 54:36chain folks the sales and marketing
  1188. 54:38folks collaborate. They want this number
  1189. 54:41to be really really high. Only if this
  1190. 54:42number is high, there is a very high
  1191. 54:44possibility of customer retention. There
  1192. 54:45is a very high possibility of getting
  1193. 54:47better deals and all this stuff. I
  1194. 54:50always wonder when I order things from
  1195. 54:52Amazon like how how well they take care
  1196. 54:55of this entire supply chain because they
  1197. 54:58order things from China and here in my
  1198. 55:00home in US when I order things get
  1199. 55:03delivered on a very next day and by
  1200. 55:06learning all these domain concepts now
  1201. 55:08I'm kind of getting better understanding
  1202. 55:10of their inner world
  1203. 55:12on you know companies like Amazon would
  1204. 55:14have very strict
  1205. 55:16uh uh strict rules on on metrics like
  1206. 55:20Otif
  1207. 55:22and their suppliers will have to have
  1208. 55:24very high like you know high performance
  1209. 55:27when it comes to percentage etc. So I'm
  1210. 55:30really glad that I'm learning this
  1211. 55:32domain concepts because in the world of
  1212. 55:34AI where technical things are being
  1213. 55:37automated the knowledge of these domain
  1214. 55:40con concepts is something that can set
  1215. 55:42you apart from the competition when it
  1216. 55:44comes to job market and career growth.
  1217. 55:47Yes, Amazon is a good example. So,
  1218. 55:48reliability is one important metric
  1219. 55:50where you always promise to deliver like
  1220. 55:52a perfect order with which is on time in
  1221. 55:55full with perfect documentation. But
  1222. 55:57there is also another metric which is
  1223. 55:58like the the response cycle time like
  1224. 56:01when you place the order or the order
  1225. 56:02fulfillment time. So that is something
  1226. 56:05which Amazon worked on. Earlier it used
  1227. 56:06to be like three or four days in in the
  1228. 56:08e-commerce world. Amazon made it like
  1229. 56:10same day, one day and now you see hyperd
  1230. 56:13deliveries which is happening in like 15
  1231. 56:14minutes, 10 minutes and all those
  1232. 56:16things. All this is based on this metric
  1233. 56:18and uh so what you spoke about is an
  1234. 56:20example of B2C where a business is
  1235. 56:22giving directly to the consumer but this
  1236. 56:25this particular concept is mostly tied
  1237. 56:27to B2B where there is one company which
  1238. 56:30is having a lot of distributors and who
  1239. 56:32are having their consumers which makes
  1240. 56:34the supply chain even more difficult
  1241. 56:35because they also have their supply
  1242. 56:37chain. they have to maintain their uh
  1243. 56:39you know they have to maintain the
  1244. 56:40promise to their consumers and it it
  1245. 56:42gets very long and most of the times
  1246. 56:45this company is also procuring from some
  1247. 56:47places like China and you know this is
  1248. 56:49why right like uh if you are getting a
  1249. 56:51product in your hand this mouse if
  1250. 56:53you're getting it today it it is
  1251. 56:55probably planned like some 300 or 400
  1252. 56:58days before before it comes to your hand
  1253. 57:00so that's that's very interesting that's
  1254. 57:01why I love supply chain it's is a very
  1255. 57:03interesting field
  1256. 57:04many of the people who are watching this
  1257. 57:06video are the uh customers of uh you
  1258. 57:10know things like Blinket, Zomemetto,
  1259. 57:14even Flipkart and all these companies
  1260. 57:17even though it's B2C internally they
  1261. 57:19also work with their their business
  1262. 57:22partners. So now you all are getting
  1263. 57:25some insights into that beautiful world
  1264. 57:28of supply chain.
  1265. 57:30Great. But supply chain is super vast.
  1266. 57:32If uh if folks you're watching this
  1267. 57:33video, if you're more interested, try to
  1268. 57:36uh you know type SC score on in Google
  1269. 57:40and uh search for this. It's supply
  1270. 57:43chain operational reference model. It
  1271. 57:45has a lot of interesting concepts. You
  1272. 57:46can you will definitely like it. Okay.
  1273. 57:49Now let's get back to this quadratic
  1274. 57:51sheet and check the formulas. I would be
  1275. 57:54really surprised if it has calculated
  1276. 57:56all these formulas correctly because we
  1277. 57:58gave no reference. Right now you know
  1278. 58:01the supply chain concepts. You can also
  1279. 58:02validate this along with me. Let's first
  1280. 58:05check the order lines. So it says
  1281. 58:09calculated from the fact order line.
  1282. 58:13So yeah total order lines is nothing but
  1283. 58:15the length of order lines. What is order
  1284. 58:18lines? It has calculated it from the
  1285. 58:21order lines. It has went to this table
  1286. 58:25and it has calculated this which is
  1287. 58:27correct. This order line table contains
  1288. 58:29all the orders. So it did not take the
  1289. 58:31unique value of dollars. So it knows
  1290. 58:33unique value of orders means total
  1291. 58:35orders. Order lines means it has to take
  1292. 58:37the entire order lines. So it is
  1293. 58:39correct. And let's see total orders. So
  1294. 58:42it says total orders is nothing but
  1295. 58:44length of order aggregate. What is order
  1296. 58:47aggregate? Okay. Oh, that's really good.
  1297. 58:50It somehow understood this fact
  1298. 58:52aggregate table contains a consolidated
  1299. 58:54order. If you are wondering just just
  1300. 58:56remember this example right these are
  1301. 58:58order lines then I consolidated it right
  1302. 59:01two orders this is the same example here
  1303. 59:03here we have all the order lines and
  1304. 59:05this aggregate is nothing but
  1305. 59:06consolidated orders so it it it did a
  1306. 59:08really good job there I'm I'm quite
  1307. 59:10surprised and
  1308. 59:13so let's see the line fill rate so again
  1309. 59:16it's using the order lines table and in
  1310. 59:18this it is calculating where the values
  1311. 59:21in full is equal to one which means the
  1312. 59:23orders which are delivered in full which
  1313. 59:26are delivered in full quantity and it is
  1314. 59:29dot mean it means it's it's it's a ratio
  1315. 59:33it's it's basically dividing that value
  1316. 59:36with the rest of the values which is
  1317. 59:37correct. So it it's taking a ratio of
  1318. 59:39values that is one versus the rest of
  1319. 59:41the values which is zero. So this
  1320. 59:44calculation is also right and the same
  1321. 59:47thing goes with volume fill rate that is
  1322. 59:50that is also correct. So it calculated
  1323. 59:52the total delivery quantity with the
  1324. 59:54order quantity sum. That's perfect. And
  1325. 59:59with the on-time delivery yes it has to
  1326. 1:00:01see on time and in full and all these
  1327. 1:00:04three things has to be calculated at
  1328. 1:00:06order level. So you see it uses order
  1329. 1:00:09aggregate table which is nothing but the
  1330. 1:00:12consolidated order level. I'm I'm really
  1331. 1:00:14surprised that this is able to calculate
  1332. 1:00:16it so accurately without us giving an
  1333. 1:00:18external references. This is this is
  1334. 1:00:20good. If you're not using AI tool, you
  1335. 1:00:23would have spent few hours and now you
  1336. 1:00:27you did all this work in few minutes. So
  1337. 1:00:30you can realize the productivity gain
  1338. 1:00:32here.
  1339. 1:00:33Yeah. But this also reinstates the point
  1340. 1:00:35that you cannot miss the fundamentals,
  1341. 1:00:37right? Let's say if you don't know the
  1342. 1:00:38supply chain concepts, if you don't know
  1343. 1:00:39the basics of Python, you won't be able
  1344. 1:00:41to validate this code. You would have
  1345. 1:00:43given this to another AI to validate,
  1346. 1:00:44but you don't know even if that is
  1347. 1:00:45correct. And this will go on. So you
  1348. 1:00:48need to know the basics and you can kind
  1349. 1:00:50of you know maximize your productivity.
  1350. 1:00:52That's how I see using the ZI tools.
  1351. 1:00:54AI models will hallucinate on occasions
  1352. 1:00:57and if you are you know deploying this
  1353. 1:00:59code to production or using it to make
  1354. 1:01:02important decisions. It is important
  1355. 1:01:06that you know the fundamentals. So you
  1356. 1:01:08all might have a question of should we
  1357. 1:01:10learn Python? Should we know uh data
  1358. 1:01:13analytics? Should we know domain
  1359. 1:01:14concepts? Yes, of course you need to
  1360. 1:01:16know because you are the one who will
  1361. 1:01:19validate if AI generated correct output
  1362. 1:01:22or not and it will make mistakes folks.
  1363. 1:01:24See right now it did a good job but
  1364. 1:01:28let's say one out of 100 times it is
  1365. 1:01:30making a mistake then that mistake can
  1366. 1:01:32cost your company a big money. the
  1367. 1:01:34company will hire you because you know
  1368. 1:01:36all these fundamentals and you can work
  1369. 1:01:38with AI and you can figure out its its
  1370. 1:01:40mistakes and you can fix it and you can
  1371. 1:01:42also guide AI you know typing that
  1372. 1:01:44prompt and you can guide AI to do the
  1373. 1:01:48right thing
  1374. 1:01:50okay now we have seen how to create
  1375. 1:01:52these KPIs right so next why don't we
  1376. 1:01:55ask some business questions and see if
  1377. 1:01:56it is able to answer it properly
  1378. 1:01:59one thing I'm curious about is if there
  1379. 1:02:01is a way to track monthly on-time
  1380. 1:02:03performance months.
  1381. 1:02:04I mean, yes, I think it should be able
  1382. 1:02:06to do, but let's see how it is
  1383. 1:02:07responding, right? I'm just simply going
  1384. 1:02:09to ask uh show me monthly
  1385. 1:02:14on time performance by cities.
  1386. 1:02:18Mhm.
  1387. 1:02:20Cuz uh if you're a VOS and distribution
  1388. 1:02:22manager, you would like to know it by
  1389. 1:02:23cities.
  1390. 1:02:25And let me do it in a new sheet.
  1391. 1:02:28I'm going to call it
  1392. 1:02:30business questions.
  1393. 1:02:35you press enter.
  1394. 1:02:39Okay, it generated a chart. I think
  1395. 1:02:41that's pretty good from this. I can
  1396. 1:02:42easily see how the trend is declining
  1397. 1:02:45and uh it's showing me pretty good like
  1398. 1:02:47how I would expect to get created in a
  1399. 1:02:50PowerBI or something. That's that's
  1400. 1:02:52good. So maybe I can ask more questions
  1401. 1:02:55to it like uh I've created a prompt. Let
  1402. 1:02:58me open it. So I want to ask like show
  1403. 1:03:00me the top five customers based on their
  1404. 1:03:02order value and their on-time percentage
  1405. 1:03:04in full percentage on time in full
  1406. 1:03:06percentage. I want to say also add the
  1407. 1:03:08customer name, customer ID and city in
  1408. 1:03:10the table. So let's see what it
  1409. 1:03:12provides.
  1410. 1:03:13I'm going to copy this
  1411. 1:03:15and folks you can mention uh in a prompt
  1412. 1:03:18if you want chart or a table.
  1413. 1:03:21you. Can I just read this one more time?
  1414. 1:03:31Okay, I pasted the prompt here in the
  1415. 1:03:33chat window and uh let's see what
  1416. 1:03:36happens.
  1417. 1:03:39And wherever you have active focus in
  1418. 1:03:41the sheets, see you have it at row
  1419. 1:03:43number 26. So I think that is the
  1420. 1:03:45location where it will insert the the
  1421. 1:03:48new visual.
  1422. 1:03:50Yes. Okay, you can see it generated the
  1423. 1:03:52data here and uh it did not generate in
  1424. 1:03:55the line 826. It generated you know
  1425. 1:03:58somewhere randomly wherever
  1426. 1:04:01and uh that's good. It just gave me
  1427. 1:04:04everything what I wanted. It gave me the
  1428. 1:04:05customer ID. It gave me the customer
  1429. 1:04:08name, city, total order value on time
  1430. 1:04:13info percentage in full percentage and
  1431. 1:04:15on time percentage. Let me quickly check
  1432. 1:04:19the code. Okay, it's taking the fact
  1433. 1:04:21summary for this which is good. So if I
  1434. 1:04:23quickly skim through this code, it looks
  1435. 1:04:25good. But if I have to do this for real,
  1436. 1:04:27I would I would spend some time with
  1437. 1:04:28this. I would spend another 10 to 15
  1438. 1:04:30minutes in this to check. But at the top
  1439. 1:04:33level, it looks correct. Yeah, I think
  1440. 1:04:35uh that's pretty much good. But as for
  1441. 1:04:38you know like uh here I ask for top five
  1442. 1:04:40customers. It seems all my top five
  1443. 1:04:42customers are in US. So let me copy this
  1444. 1:04:45same prompt here and see if it is
  1445. 1:04:48consistent. I'll put it here and say
  1446. 1:04:51show me top five customers in India.
  1447. 1:04:53I'll just add one more line here
  1448. 1:04:56and see what result it provides.
  1449. 1:05:02I think that's very consistent. It gave
  1450. 1:05:04pretty much the same results but with
  1451. 1:05:07Indian customers. That's good. That's a
  1452. 1:05:08good summary table.
  1453. 1:05:10Yep. Looks amazing. You just type a
  1454. 1:05:13prompt and it is doing most of the work
  1455. 1:05:15for you.
  1456. 1:05:16Yeah, I I I mean it's it's amazing. But
  1457. 1:05:18at the same time, I would say this also
  1458. 1:05:21reinstates the point to me. The
  1459. 1:05:22fundamentals are very important. You
  1460. 1:05:24cannot simply work with a tool like this
  1461. 1:05:26without knowing the fundamentals of
  1462. 1:05:27Python coding or knowing about supply
  1463. 1:05:30chain. Not having any domain expertise,
  1464. 1:05:32it's not going to help. That's why we
  1465. 1:05:34always stress that having domain
  1466. 1:05:35knowledge and having the fundamental
  1467. 1:05:37understanding of this coding really
  1468. 1:05:39helps a lot. Okay. I highly recommend
  1469. 1:05:41you to practice this along because
  1470. 1:05:42quadratic is free. They provide some
  1471. 1:05:45free AI credits. There is no excuse for
  1472. 1:05:47you. You need to practice this. And they
  1473. 1:05:51also promised the quadratic team also
  1474. 1:05:53promised to provide some special
  1475. 1:05:54discount for the learners of this
  1476. 1:05:56channel. We are putting that in the
  1477. 1:05:57description. You can use that and get a
  1478. 1:05:59special discount if you are taking a pro
  1479. 1:06:01account. So like I said, please do
  1480. 1:06:03practice and also know that this is not
  1481. 1:06:06the end, right? There are a lot more to
  1482. 1:06:07explore, a lot more to learn and we are
  1483. 1:06:09planning to bring more videos of this
  1484. 1:06:11kind where we are just going to provide
  1485. 1:06:13a very you know unbiased and neutral
  1486. 1:06:15view of the tools because they are in
  1487. 1:06:17the evolving space. We just want to
  1488. 1:06:19break down the hype and show you the
  1489. 1:06:20reality and I hope you found this video
  1490. 1:06:23really useful.
  1491. 1:06:24This is the end and I want to mention
  1492. 1:06:25very important thing which is exercise.
  1493. 1:06:28In the video description below when you
  1494. 1:06:30click to download files you will find a
  1495. 1:06:32file called exercise.pdf.
  1496. 1:06:35Please look into it and work on that
  1497. 1:06:37exercise. If you have any questions,
  1498. 1:06:39there is a comment box below. If you
  1499. 1:06:41like this video, please give it a thumbs
  1500. 1:06:42up and share it with your friends who
  1501. 1:06:44are learning analytics and AI.
  1502. 1:06:47[Music]

About this transcript

This page contains the full transcript of Data Analysis using AI Tools | Quadratic | N8N | Supply Chain by codebasics, generated from the public captions YouTube serves with the video. The transcript has 10,289 words across 1,502 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.