Data Analysis using AI Tools | Quadratic | N8N | Supply Chain — Transcript
Full transcript
- 0:00We are going to build end to end
- 0:01analytics projects using AI tools in
- 0:04supply chain domain. In terms of text
- 0:06tech, we will use Netn which is an AI
- 0:09workflow automation tool to pull data
- 0:12from Excel files and it will ingest the
- 0:14data into Postgress SQL database. Then
- 0:17we will use another AI tool called
- 0:20quadratic which is an AI powered
- 0:22spreadsheet that will pull data from
- 0:24Postgress SQL database and we'll show
- 0:26you how you can perform analytics using
- 0:29some prompts in this quadratic tool.
- 0:31This project will teach you important
- 0:34supply chain domain concepts as well as
- 0:36it will teach you how you can build
- 0:38projects using the modern AI tool
- 0:41mindset. This project is not only uh
- 0:44perfect for your learning but it is
- 0:46something you can add in your resume as
- 0:48well as your project portfolio. Let's
- 0:50begin with some interesting story line.
- 0:55Atlart is a Gujarat based organic food
- 0:58manufacturer. They specialize only in
- 1:01few products but disrupted the market in
- 1:04the two cities they operate.
- 1:07In an interesting move, they opened
- 1:10their third city of operation in New
- 1:13Jersey, America, and started performing
- 1:16well there as well. Though they handle
- 1:19very less products, their supply chain
- 1:22is immature. Bruce Hurali, the chief
- 1:26operating officer of Atlique Mart, has
- 1:28noticed that some of their supermarket
- 1:31customers are dissatisfied with their
- 1:34order management and he wanted to fix
- 1:37this before scaling further. Bruce
- 1:40discussed this with Tony Sharma, the
- 1:43head of analytics at Atlake Mart and
- 1:46understood the problem is a classic
- 1:49supply chain issue where they are not
- 1:52able to maintain an optimum inventory.
- 1:54Tony offered to create a quick insights
- 1:57report using Excel or PowerBI, but Bruce
- 2:02insisted that he needs something AI
- 2:04powered as a solution because like any
- 2:08other senior leaders in the world, Bruce
- 2:10does not want to miss out on the AI
- 2:13hype. Tony assigned this work to Peter
- 2:16Pande who is a curious data guy in the
- 2:20team exploring all the AI tools in the
- 2:23market. Peter, who always thrives to
- 2:26drive the extra mile, found quadratic,
- 2:31which is an AI powered spreadsheet that
- 2:34even offers connection to their database
- 2:37in Postgra DB. He even figured out an
- 2:41automation using N8N to migrate the data
- 2:45directly from emails to Postgra.
- 2:49So you will be solving the supply chain
- 2:52problem along with Bruce, Tony and Peter
- 2:56using Quadratic, the AI powered
- 2:59spreadsheet N8N to automate the data
- 3:02migration and learn important supply
- 3:05chain domain experts. Let's get started
- 3:08folks.
- 3:11[Music]
- 3:20Let us discuss the technical
- 3:22architecture for this project. We will
- 3:24get our data through email.
- 3:27You'll get these kind of emails which
- 3:29will have files attached to it. I have
- 3:33two emails. One for India sales, one for
- 3:35USAS sales. And when I open this email,
- 3:38I will see this kind of CSV file where
- 3:41this file contains aggregate data. You
- 3:44can see order ID, customer ID, order
- 3:47placement date and few other fields. The
- 3:49second file contains the order line
- 3:53items. So order ID, order placement ID
- 3:56and there are some detailed fields like
- 3:58the product ID, the order quantity and
- 4:02so on. So all of these data is coming
- 4:06via email in your inbox. And by the way,
- 4:10we are going to provide you these files.
- 4:12So what you can do is you can take these
- 4:15files and you can send it to your own
- 4:18email and you can configure your
- 4:22automation workflow to monitor that
- 4:24email. So let's talk about the
- 4:26architecture. So here are the emails
- 4:29that you're getting and they have this
- 4:31uh spreadsheet attached to it and then
- 4:35you are using uh let me just draw one
- 4:38more block here. So you are using this
- 4:42tool N8N for the automation. Okay. And
- 4:47this tool is basically
- 4:51an AI agentic automation tool and it is
- 4:57monitoring
- 4:58these uh emails. So you can configure it
- 5:02to monitor your email inbox. You can
- 5:06provide the labels, the subject line,
- 5:09you can provide all that filtering.
- 5:10Okay. And as a next step what you're
- 5:12doing is you are ingesting the data uh
- 5:17into your posgress. So here will come
- 5:21your posgress database. Okay. So this is
- 5:26your posgress database and then you are
- 5:29attaching the quadratic AI. So let's say
- 5:33I have my
- 5:35quadratic tool. Uh it is your AI
- 5:38spreadsheets.
- 5:40So you are pulling data from posgress
- 5:45into quadratic and here you are doing
- 5:49your analysis your promptbased
- 5:52AI analysis is being done in the
- 5:54quadratic. So this will be your
- 5:56architecture. Just to summarize, emails
- 5:58are coming to specific inbox and this is
- 6:00what happens in the industry where some
- 6:04vendors or let's say some team member
- 6:06will be sending all these Excel files
- 6:09via email in specific email ID and inbox
- 6:13and you can configure your N to monitor
- 6:15that inbox. In nin you will do all the
- 6:18processing. We'll look into that in
- 6:19detail. And then data goes into
- 6:21Postgress and from Postgress you would
- 6:24pull the data into quadratic to do your
- 6:27analysis.
- 6:31So I'm assuming that using the link in
- 6:33the video description below, you have
- 6:36received all these files and you have
- 6:37sent two emails. one containing data for
- 6:40US, the other containing data for India
- 6:44into your personal inbox or whatever
- 6:47email id that you want to use for this
- 6:49project. Okay. And now we are going to
- 6:51set up N8N.
- 6:54In case if you have not used this
- 6:55before, this is an AI agentic workflow
- 6:59automation tool which is getting very
- 7:01popular nowadays. Go to n8.io.
- 7:05Sign in using whatever credentials. I
- 7:09have already signed in and you will get
- 7:1314 days free trial.
- 7:20So I'm on the homepage. So here when you
- 7:23come for the first time you will uh see
- 7:25little different UI. I mean all these
- 7:27things will still be there. So you're
- 7:29going to create a workflow here and in
- 7:32that workflow you will add a first step
- 7:35and this first step is to monitor
- 7:39your Gmail. So you click on Gmail on
- 7:43message received. So here whenever you
- 7:47receive a message into your Gmail
- 7:48account you want to trigger this
- 7:51automation workflow. These workflows can
- 7:53be triggered via different means. In our
- 7:56case, it is triggered whenever new email
- 7:59comes to our Gmail account. Now here I
- 8:02have already added my authentication.
- 8:04But essentially what you can do is
- 8:06create new credential and here sign in
- 8:09with Google. So you will say sign in
- 8:11with Google. You will provide all the
- 8:13credentials. It is pretty common sense
- 8:15folks. You should know how to do it.
- 8:17Okay? And if you don't just take help of
- 8:20chat GPT. So you will uh log to your
- 8:24Gmail credentials and after you have
- 8:27logged in you will get this thing okay
- 8:30Gmail account so I have configured that
- 8:33particular email id right this
- 8:35particular email id I have already
- 8:37configured it and then here
- 8:41I'm saying monitor this Gmail for every
- 8:44minute for incoming emails and here uh
- 8:49just uncheck this because we will need
- 8:51this option and in add filter you will
- 8:55say labels okay label label names or ids
- 9:00and I want to use my inbox so I'm
- 9:03monitoring my inbox essentially
- 9:06then search
- 9:09so in the subject you will say
- 9:12okay what is the subject look like so in
- 9:15the subject you will say daily sales so
- 9:18all these emails will have specific
- 9:20subject subject. So you have to identify
- 9:21that pattern. So I'm saying that if my
- 9:24subject contains daily sales. Okay. So I
- 9:28will say subject contain daily space
- 9:31sales then look at that subject and in
- 9:35the options you will say access the
- 9:38attachments. Okay. So once again uncheck
- 9:41this simplify only then you will see
- 9:43this particular options. Now I can say
- 9:46fetch test event and see it is able to
- 9:50fetch that particular file. So if you
- 9:52look at this particular email what it
- 9:54did is it went to this particular inbox
- 9:58and it pulled this particular email okay
- 10:02so you have two attachments okay 4.8 8
- 10:05KB 20 KB and when you look at it 4.921
- 10:10right so so almost same so fact
- 10:12aggregate India so this is the email for
- 10:14India so it it pulled the most latest
- 10:17email here so this is looking good in
- 10:19case if you want to view the file you
- 10:22can click on view and you should be good
- 10:24to go click on back to canvas button so
- 10:28this thing is good the next step here is
- 10:32to extract the data so we will say
- 10:35extract from file. So now we are pulling
- 10:38those files but we need to extract data
- 10:41in a JSON format. Okay. So we will say
- 10:45extract from CSV
- 10:47and here
- 10:49you will provide this field. So you are
- 10:51saying that we have two attachments. One
- 10:54is aggregate data, one is detailed order
- 10:56line data. So we want to firsth process
- 11:00this particular file which is your
- 11:02aggregate file. And here if you click on
- 11:04JSON
- 11:06you you see this if you look at JSON it
- 11:08is mapping this 128 items and it is
- 11:12pulling all these fields. All right. So
- 11:15this part looks good. Now if you just
- 11:18say test step it will actually show you
- 11:20these. Okay. So this you will be able to
- 11:22see when you click on test step. So
- 11:25that's it I think. So essentially you
- 11:29are converting your CSV data into JSON
- 11:31format through this step. The next step
- 11:34then is to uh get this data and ingest
- 11:38it into Postgress. Okay. So here
- 11:45click on Postgress
- 11:48and insert rows in table.
- 11:52So now you need to connect it to your
- 11:55Postgress account. I have already
- 11:57connected it with my posgress account
- 12:00but for you you will click on create new
- 12:02credentials and it will ask you for all
- 12:04these details. Now you need to use uh
- 12:08superbase. Okay. So superbase.com go to
- 12:11that website and create your login. You
- 12:13can create your free login. So I'm
- 12:15already logged in into this account.
- 12:18Superbase is a way to host your
- 12:20Postgress database on cloud. See you can
- 12:24run Postgress database on local machine
- 12:26but this allows you to run it on a cloud
- 12:29and Postgress just in case if you don't
- 12:31know is a relational database that also
- 12:34provides no SQL capabilities but here we
- 12:37are essentially using it as a relational
- 12:39database only. So create an account
- 12:42using I think Gmail or whatever again
- 12:44pretty pretty common sense uh thing that
- 12:47we are doing here and you will have some
- 12:50organization etc. Uh so create an
- 12:52organization if you have not created
- 12:54already and when you go here uh you need
- 12:57to create a project and by the way we
- 12:59are going to provide all the steps
- 13:02related to this in a PDF file. So once
- 13:05again check video description you will
- 13:07get a link through which you will be
- 13:09able to download all these files and one
- 13:11of the files will be to set up your
- 13:14posgress on superbase. Okay. So please
- 13:19follow those uh files we have given
- 13:22everything in detail. I have already set
- 13:24up my database because I don't want to
- 13:26waste uh time and I I don't want to make
- 13:29it like a very long tutorial. So I
- 13:32already uh set up my database and my
- 13:34database looks like this. Once again
- 13:36these these steps are provided in the
- 13:38video description. So check it out.
- 13:45Okay. So these are the tables that I
- 13:47created and you as you can see I have
- 13:50two fact tables and three dimension
- 13:53tables. Just in case if you don't know
- 13:56about fact and dimension table I have a
- 13:59video on YouTube this one star schema
- 14:01video you you can watch it but
- 14:04essentially fact table contains your
- 14:06transactions whereas dim table contains
- 14:09your dimensions such as customers you
- 14:11know the information that doesn't change
- 14:12too often customers products and all
- 14:15that but fact is more like a
- 14:17transactional data you you see it kind
- 14:19of changes and if you look at the data
- 14:23here we have a data till 56
- 14:26you know you can sort descending and we
- 14:29have data till 16 May right sort
- 14:32ascending let me see so order placement
- 14:36date sort descending 516 okay so I'm
- 14:41assuming you have followed all the
- 14:43instructions from that PDF file that we
- 14:45are attaching and your database is ready
- 14:48now to get the connection string you
- 14:50will go here okay and you will look into
- 14:53your session session puller and you will
- 14:55use all this information host port etc
- 14:58and you will enter that information
- 15:00here. So for example my host will be you
- 15:04copy from here and you you know this is
- 15:08my host my database is posgress my user
- 15:12is
- 15:14this one so you will put user here you
- 15:17will use the same password that you use
- 15:19to login into superbase okay so let's
- 15:22say you have put the password uh port is
- 15:245432
- 15:26and that's it and when you set save it
- 15:29will create a connection into your
- 15:31postgrace database. I have already
- 15:34created it so I'm not creating it again.
- 15:37And once you have created it, you will
- 15:39see this option you know postgrace
- 15:40account. So I'm just clicking that and
- 15:44this is the insert operation and you
- 15:48want to insert data to your fact orders
- 15:51table. See we are looking at the first
- 15:53attachment. Okay. So our first
- 15:55attachment is this fact aggregate table.
- 15:58We are ingesting this data into fact
- 16:02orders aggregate and here you need to do
- 16:07uh this mapping. Okay. So order ID goes
- 16:09to order ID. Customer ID goes here.
- 16:13Order placement date goes here. And here
- 16:16I want to format this date differently.
- 16:18So here it is month, year and um
- 16:22actually date, month and year. But what
- 16:25I want to do here is I want to say
- 16:28convert it to date time
- 16:41when I was doing this two date time
- 16:44initially I was getting an error. See if
- 16:46you do
- 16:47just the
- 16:49two date time you get error that you
- 16:52cannot convert to luxen date time. So
- 16:56the format for the date that we have in
- 16:59our email. So let's look at that. So
- 17:02here the format is ddmm and then year
- 17:05and looks like that luxen I think it's a
- 17:07javascript library is not able to
- 17:09understand that. So we need to tell it
- 17:12okay what format is this? And if you
- 17:15look at the documentation of this see if
- 17:19you look at I think two data yeah here
- 17:24in the bracket you can specify the
- 17:25format. So they have this documentation
- 17:28which says you can specify this
- 17:30particular format where you can say ddmm
- 17:32y. So I'm going to use this and I'm
- 17:36going to specify that format. After that
- 17:39it is parsing that this particular date
- 17:41into datetime object and then you are
- 17:44saying format.
- 17:46So I want to essentially convert this
- 17:49into this format where you have year
- 17:52first then month. This is like iOS
- 17:54standard format. So that way you know uh
- 17:58the injection into postgrace is
- 18:00smoother. Okay. Okay. So sometimes you
- 18:01have to do all this date conversion,
- 18:03format conversion etc into your this
- 18:06this mapping that you are creating in N8
- 18:10and I already map on time info
- 18:14if and so on. Okay. So test the step.
- 18:18After testing the step when I go to my
- 18:21Postgress database I will see data for
- 18:2417th May. See 17th May. Previously it
- 18:27wasn't there. I had it till 16. So
- 18:30through this step it inserted that data
- 18:35from that file. Okay. So now what I can
- 18:40do is I can go back. I think this
- 18:44mapping looks good to me. I will just
- 18:48copy this because I might need this in
- 18:50the when I'm doing the mapping for the
- 18:52other file. Okay. So this one this flow
- 18:56is good enough. Now we will need to map
- 19:00the other file. So here this one I will
- 19:03rename and I will say extract from
- 19:06extract from file
- 19:10aggregate. Okay.
- 19:12And you need to now create another flow
- 19:16for the second file. Remember we have
- 19:17two files. So the second file is your
- 19:21order line items. So here you will
- 19:26specify your second file here. Okay.
- 19:30And the test tab. So it is pulling the
- 19:33data from the second file. See you can
- 19:35see all these fields. Go back to canvas.
- 19:39And here add your postgress. Same folks
- 19:43you are just repeating the same steps
- 19:46here.
- 19:48And
- 19:49here you are specifying your order line
- 19:52table line item table.
- 19:56And then just see map these fields.
- 20:04And for order placement date you will do
- 20:06the same thing to date time and in this
- 20:10two date time you will specify
- 20:15this particular format. Okay. So let me
- 20:17just copy paste. This is the format
- 20:21I am using
- 20:24and then I'm formatting it to this
- 20:26format ISO format Y
- 20:29mm DD. Okay. Then customer ID. So make
- 20:33sure you're mapping
- 20:36all these fields accurately. I mean
- 20:40sometimes people might drop one field
- 20:41into another. So if you make that
- 20:43mistake, of course it's not going to be
- 20:45good. So just map it.
- 20:55As you can see all the fields are
- 20:57mapped. The only format conversion is
- 21:00happening with order placement date.
- 21:01Other fields are okay. And I will click
- 21:04on test step here.
- 21:07Input invalid for agreed delivery date.
- 21:11So looks like we will just use the same
- 21:15format for these dates because
- 21:19see it had a date 35 2025. So maybe it
- 21:23got it wrong over there.
- 21:25So we are converting it to standard DDMM
- 21:30Y format first and then converting it to
- 21:32our standard ISO format. So let's do it
- 21:35for all the dates. Okay. Do we have any
- 21:37other dates? So on time is good. Okay.
- 21:40dates are being taken care of. Okay,
- 21:43let's test the step now.
- 21:50I was getting all those errors because
- 21:52there was some format error with my
- 21:55Excel file and I have fixed those. Okay.
- 21:58So, if I pull my files here, CSV files,
- 22:02then these date formats were previously
- 22:05inconsistent. So, I was getting it. You
- 22:06will not get these errors because I have
- 22:09fixed those issues. Okay. So if you're
- 22:11using this new files which we are going
- 22:12to attach down below, you're not going
- 22:15to get those errors. So now u but I
- 22:19think it's still a good idea to convert
- 22:21it to standard
- 22:23ISO format. Okay. And then do the format
- 22:26conversation to conversion to whatever
- 22:29format you need. So we are going to do
- 22:30it for all the dates here. And once you
- 22:33are ready, you can taste this particular
- 22:37step. So let's test this.
- 22:41All right, it executed it fine. If you
- 22:44go to your database and if you look at
- 22:47your order line items, see it is still
- 22:50refreshing. Right now it's showing 16.
- 22:52Now it changed. You see it changed. So
- 22:54it inserted all the records from 17th
- 22:56May. But I I previously deleted the
- 23:00records from
- 23:02aggregate as well. Okay. So I I still
- 23:04don't have aggregate record because I
- 23:05was fixing those errors. So you don't
- 23:07have to run these steps but I'm going to
- 23:10u just execute this one
- 23:14so that I see the 17th data in both of
- 23:17it. Okay. So here
- 23:20so essentially you want to go to a stage
- 23:23where you see the data for 17th for both
- 23:26fact order online and fact orders
- 23:29aggregate.
- 23:31Now just in case if you're facing errors
- 23:33and if you're running it again and again
- 23:35and if you want to delete the data you
- 23:36can use this query you can you know if
- 23:39you want to delete the data let's say
- 23:41there is some problem you can use this
- 23:43query you can say delete from fact order
- 23:45line where order placement date greater
- 23:48than this so that way you are deleting
- 23:50that 17th May data uh you you need to do
- 23:54it for both the tables okay so one for
- 23:56fact order online and the other one for
- 23:59aggregate table. Uh so so let me do it
- 24:02so that you know. So let me delete these
- 24:05records. Okay. So delete all the records
- 24:07for
- 24:09aggregate table first. So these records
- 24:11are deleted and then delete it for
- 24:15the um
- 24:19other table. Which other table we have?
- 24:22Order online. Right?
- 24:24So see I deleted these records. And when
- 24:27I go to postgrace
- 24:30uh the table view
- 24:32so it is refreshing you see down below
- 24:34it is still refreshing but when it is
- 24:37refreshed you see data only till 16 same
- 24:40here you need to have sorting by the way
- 24:42okay don't forget that that's uh see
- 24:44it's still refreshing so let me just
- 24:46yeah 16 see and it is sorted based on
- 24:50descending order so to ingest the data
- 24:53now I will run the entire workflow so
- 24:56after deleting it. When I go here and
- 24:59when I say test workflow, it will taste
- 25:02both the workflows. See first that first
- 25:05file, second one is second file. And
- 25:07when I come here now and refresh, I
- 25:12should see data for 17th. See 17th May.
- 25:16Same for the second table. When I
- 25:18refresh, I will see data for 17th May.
- 25:22All right. Our data injection part is
- 25:24over. Now one additional thing I will do
- 25:26is also ingest the file for USA.
- 25:30Remember so far we ingested data only
- 25:32for India. You are given all these
- 25:35files. So you will find two files for
- 25:37USA. And I'm going to compose an email.
- 25:41I'll just send it to myself and just say
- 25:44daily
- 25:46sales USA
- 25:5117th May. And I will just attach these
- 25:55files. So attach both the files for USA
- 26:00and send it. So when you send it, see I
- 26:02see the email here.
- 26:04But my workflow has not triggered yet
- 26:07because
- 26:09it is inactive. You see the workflow. I
- 26:12gave it a name postgris data injection.
- 26:14It is still inactive. If it was active,
- 26:17it will be monitoring my email and it
- 26:20will be sending it. But you can kick it
- 26:23off manually as well. So I'll click on
- 26:27test workflow
- 26:29and see here it inserted 57 items and
- 26:34here 109 items.
- 26:37So let's verify if that is correct. So
- 26:40USA
- 26:42aggregate data see 57 item because there
- 26:44is a header. So 57 items total. So that
- 26:47is correct. And then order line for USA
- 26:51is
- 26:54109. There is a header. So 109 rows in
- 26:57total. 109. So it inserted that data.
- 27:03And here
- 27:07I think here even if you refresh it will
- 27:09still show 17. So you have to look into
- 27:11the order ID and stuff like that. But
- 27:14let's see order line as well. So both of
- 27:17these tables are updated with USA data.
- 27:23Let's now analyze this data in
- 27:25quadratic. Quadratichq.com is a website
- 27:29you will go here. You can chat with your
- 27:32data and get insights all using AI.
- 27:36Click on open quadratic. So you will
- 27:38come here. You're going to get some free
- 27:40credits by the way. So don't worry,
- 27:42you'll have enough credits to run this
- 27:44project. And then here you will click on
- 27:48new file. Then let's connect this to
- 27:51posgress. So here uh just click on
- 27:55posgress. Okay. And connection name you
- 27:58can say anything right like atlick m and
- 28:02then provide that same host name.
- 28:05You see like when we were here in the
- 28:08session pooler you need to provide this
- 28:10host port database user or whatever
- 28:14right? All these credentials you can
- 28:16provide here. Password will be the
- 28:18password for your superbase
- 28:20and once all of that is done you will
- 28:23see this kind of entry postgress entry.
- 28:26So you click on it and you will see this
- 28:29connection. See it is pulling all these
- 28:30tables here dim customers etc. You can
- 28:33also write queries by the way. You can
- 28:35write select queries to fetch this data.
- 28:39So let's pull all this data for dim and
- 28:42fact tables in our quadratic
- 28:44spreadsheet. So the first one is going
- 28:47to be dim customers. So let me name this
- 28:50sheet dim customers
- 28:53and then you can click on this dim
- 28:55customer here query selected table and
- 28:58see it will pull all that data. Isn't
- 29:01this cool? So we have only 37 customers
- 29:05and it is running this query with a
- 29:07limit. Ideally, you should run this
- 29:09query without limit. But in our case,
- 29:11it's okay because the number of rows are
- 29:1337. They're less than 100 anyway. Then
- 29:16you will create the second one which is
- 29:21dim
- 29:22products and check dim products
- 29:27query select table. Okay. And run it.
- 29:31Right now I think there is some kind of
- 29:33issue due to which I'm not able to do
- 29:35it. So what I usually do is and we have
- 29:38passed this feedback to quadratic team
- 29:40they will fix it okay it's just a
- 29:42temporary thing but just in case if
- 29:44you're facing this problem click on this
- 29:46database icon once again click here then
- 29:50come here then click on query and it
- 29:54will pull the data. Third one is dim
- 29:57target
- 29:59orders
- 30:01and once again click here click on this
- 30:05query selected table now here I have
- 30:09only 20 records so I'm good then fact
- 30:15order online back.
- 30:32Okay, in dim target orders, I think I
- 30:34made a mistake. I'm just saying this
- 30:37one. Actually, I should be pulling data
- 30:38from a different table. So, let me just
- 30:41delete this and
- 30:45dim target orders. Right. So dim target
- 30:47order should be this
- 30:49query. Okay, query is not working. So
- 30:52let me just go here
- 30:54again. Say query
- 30:57and here only 37. So I'm good. The next
- 31:01one is fact order
- 31:06fact order line. Okay, fact order lines
- 31:09which is this table.
- 31:12And for that particular table once again
- 31:16connect to posgress
- 31:19and select that fact order line and
- 31:22query. Now when I query I will pull only
- 31:24100 records but there are more actually.
- 31:27So what you should do is uh remove this
- 31:29limit clause and execute the query
- 31:32without limit so that you can pull all
- 31:36the orders. See how many orders do I
- 31:39have? See you have so many orders. Okay,
- 31:41it's definitely more than 100. So you're
- 31:43going to pull that and same way setup
- 31:45fact orders aggregate.
- 31:56See, so I got these many records. So
- 31:58make sure you are running your queries
- 32:01without the limit clause. And I realized
- 32:04that even dim customer table was also
- 32:06mapped incorrectly. Maybe I selected the
- 32:09wrong one. So for dim customer make sure
- 32:11you are selecting the right table. Okay
- 32:13that's very important. Okay. So see you
- 32:16are in dim customer uh sheet dim
- 32:19customer query and that's it. Right. You
- 32:21can move the table here. So we are all
- 32:24set. Whenever you are doing this kind of
- 32:25analysis you almost always need a date
- 32:28table. A table which has the required
- 32:30dates with extra columns for months year
- 32:34etc. If you have worked as a data
- 32:35analyst you will know the importance of
- 32:37this dim date table. Okay. So I'm going
- 32:40to create
- 32:41this dim date table. And the good news
- 32:44is that with AI you can just type a
- 32:47prompt here and create that table with
- 32:49all the required prompt.
- 32:56Okay. So that it's very easy. So I'm
- 32:58going to copy paste this prompt for
- 33:00creating the date table. and make sure
- 33:04when you're running this prompt you have
- 33:07this as a active sheet. Let's say if you
- 33:10select this then you see it will insert
- 33:12a table in that sheet. You don't want
- 33:14that. Okay. So click here. So that way
- 33:18you see dim date that is your active
- 33:19sheet where you're working. This is your
- 33:22uh cursor location and you are saying
- 33:24that create a date table that has dates
- 33:27from this March 1st to March 31st.
- 33:32And when you do this, it will use AI to
- 33:36first write Python code and it will then
- 33:39execute that Python code. And you can
- 33:42see the output. See date table. It's so
- 33:44awesome. So you have dates from 1st
- 33:48March to whatever. And you have separate
- 33:51columns for year, month, day. All of
- 33:54these are useful when we will do the
- 33:56analysis later on. You can also see the
- 33:58code. So if you click on this icon you
- 34:01can see the code and if you know Python
- 34:04coding if you want to let's say change
- 34:07certain things you can modify the code
- 34:09manually or you can chat here that okay
- 34:12do this particular change at this line
- 34:14or change the format of this column and
- 34:16so on. The next step for our analysis
- 34:19will be to create the exchange rates
- 34:23sheet. Okay. So I'm going to create
- 34:27exchange
- 34:29rates sheet and this sheet will uh
- 34:33contain the exchange rate conversion
- 34:36between USD and INR. Okay. And that
- 34:38conversion is required because later on
- 34:41we need uh this for performing our
- 34:44analysis. See if you want to say okay
- 34:46what are my sales number in USD and what
- 34:49are my sales number in INR then you need
- 34:52some kind of conversion right because
- 34:54our business is in both the location
- 34:56India and US and you notice that we have
- 34:58sales number coming in for both the
- 35:01countries in our product table also see
- 35:04we have INR and USD price so you know
- 35:08this conversion the exchange rate table
- 35:11that we have it can be useful now how do
- 35:13you get the exchange rates. Well, we are
- 35:17going to use this website called
- 35:19openexchange rates.org to get the actual
- 35:22conversion rate. Okay, we are not going
- 35:24to use some dummy one. So, you create an
- 35:27account using your Gmail or whatever
- 35:30whatever way you want to create account
- 35:31up to you. And when you go to your
- 35:33dashboard, you will create this app ID.
- 35:37Okay? So you will create this app ID
- 35:40which is sort of like an API key and you
- 35:43will use this in that quadratic. Okay.
- 35:45So make sure you have the app ID copied
- 35:48somewhere. So you copy it and then you
- 35:51are going to use a prompt. So once again
- 35:54the prompt that we have given you. This
- 35:56is the prompt. See create an exchange
- 36:00rate table from this date to that date
- 36:03and use this open exchange rate API.
- 36:07Okay. So you're telling that your LLM to
- 36:10kind of create a code for it. So let me
- 36:13just copy paste here.
- 36:16Copy paste here and make sure once again
- 36:19exchange rate is the active sheet. I
- 36:22will supply here. By the way this app ID
- 36:24you see this app ID here in the prompt.
- 36:27You will use your own app ID. Okay. This
- 36:30app ID we are going to delete. So it
- 36:31will not be valid. So it will not work.
- 36:33So replace this app id with your app id
- 36:36that you have created on open exchange
- 36:39rates.org
- 36:41and after that you will write uh you
- 36:45will give this prompt it will generate a
- 36:47python code. So let's look at the python
- 36:49code here.
- 36:51You see this is the python code that it
- 36:54has written and it is executing it right
- 36:56now. All right. How cool is this? I see
- 36:59the exchange rate table. This is USD to
- 37:03INR rate. Okay. And if you want to make
- 37:06any changes in Python code, feel free. I
- 37:09know Python coding. So I can make a
- 37:12change such as the exchange rate. I need
- 37:14it only till four decimal precision.
- 37:18Okay. So I can change the code manually.
- 37:21But let's say if you don't know Python
- 37:23coding, you can ask here that I want the
- 37:30exchange
- 37:32rate
- 37:34to be in four decimal precision and it
- 37:39will update that code and it will rerun
- 37:42it again. I still believe having coding
- 37:45skills is useful because sometimes you
- 37:48get give this prompt and let's say see
- 37:51it made some code changes. Okay, see it
- 37:53is rounding it to four decimal. I'm
- 37:55accepting but I know coding that's why I
- 37:58can say okay it's a correct change. If
- 37:59you don't know coding at all sometimes
- 38:01you know you might get bad result. So I
- 38:04believe having coding skills can still
- 38:07help you although we are doing automated
- 38:09coding through uh this AI but anyways
- 38:13this will rerun it again and you will
- 38:15see the new result. Okay you see these
- 38:18numbers are in now four decimal
- 38:20precision. So exchange rate table is
- 38:23created. It's looking good. Now let's
- 38:25move on to the next step which is doing
- 38:28data cleaning and summarizing required
- 38:30data in one table. We are going to
- 38:32provide you this document. So you'll be
- 38:34able to copy paste this entire prompt
- 38:37which is marked in yellow. So let me
- 38:39copy paste this entire prompt here
- 38:43and we will run this prompt in a new
- 38:46sheet. We'll call it fact summary. So in
- 38:50fact summary
- 38:52let's run this prompt. Okay. And when
- 38:55you run this prompt uh after some time
- 38:58it will create uh this particular merge
- 39:01table. Now what exactly was this prompt?
- 39:05So if you have done data analysis
- 39:07you know that you need to merge all this
- 39:10dim and fact table into one uh
- 39:13denormalized table which contains all
- 39:15the columns. Okay. So we are saying that
- 39:18load data from fact table this dim table
- 39:21exchange rate table and then clean the
- 39:24data. Okay. So you're cleaning uh
- 39:27product see converting product ID and
- 39:29customer ID to numeric because they were
- 39:31string then uh removing wide spaces
- 39:35because usually in the real life data
- 39:37sets you will find all these white
- 39:38spaces null ids you are converting ids
- 39:42to integers dates to date time. So if
- 39:44you have worked in data analysis, these
- 39:46are the typical steps that you follow
- 39:50okay like cleaning data then merging the
- 39:53table and then you will say okay merge
- 39:55these tables using this column okay
- 39:57product ID column customer ID column and
- 40:00so on. Then you will also calculate the
- 40:03total amount. See you are doing the
- 40:04currency remember we did that currency
- 40:07conversion USD to INR rate whatever. So
- 40:10you are doing that uh conversion and
- 40:13then you are producing this uh final
- 40:15output and you will see this kind of
- 40:17table at the end. All right, you can do
- 40:19some uh testing. You can look at some
- 40:21couple of rows and make sure your data
- 40:23is correct. But the way I'm seeing it
- 40:27right now is we have one merged table.
- 40:30Not only merged table but we have done
- 40:32cleaning as well. And in the code that
- 40:35was generated um if you look at it see
- 40:38it is using data frame and it is doing
- 40:41some internal cleaning.
- 40:44You see if you know pandas and python
- 40:47see it is doing conversion to date time
- 40:50then it is merging it is creating some
- 40:53calculated columns and finally it is
- 40:55creating this uh final fact summary
- 40:58sheet.
- 41:01All right, we will now begin our data
- 41:03analysis session. Here with me, I have
- 41:06Hamand Vial who has worked as a data
- 41:08analytics manager in Europe for more
- 41:11than 7 years working on multiple large
- 41:14scale data analytics projects. He's also
- 41:17a supply chain domain experts. So the
- 41:20goal here is to teach you not only data
- 41:23analytics using AI but also teach you
- 41:25important supply chain concepts. Over to
- 41:28you Haman. Thank you D. That's very
- 41:30exciting to be here to work on a supply
- 41:32chain project and I have seen the data
- 41:34that we have created from quadratic and
- 41:36we have pulled the data from superbase
- 41:38postgrade and the next step is to create
- 41:41supply chain KPIs. Correct?
- 41:43Yes.
- 41:45So before we create the KPIs as a data
- 41:48analyst the first thing to do is to
- 41:50validate the data that you got on this
- 41:52quadratic spreadsheet with what we got
- 41:54in the superbase.
- 41:56So let's do that step first. So I'm
- 41:58opening this sheet. Okay, I'm going to
- 42:00this dim customers table. So here we
- 42:03have 37
- 42:06which means 35 rows because the first
- 42:08two rows are headers. And let me go to
- 42:10the superbase postgrade database.
- 42:14So here we have 35 that's exactly
- 42:16matching. So we are good. And then we do
- 42:20the same thing for products. We have 18
- 42:22here. We have 18 here as well. That's
- 42:24good. And then we have targets. Target
- 42:26orders. We have 35 here and 35 here as
- 42:29well. That's also good. So now let's go
- 42:31to the fact order line. So in here the
- 42:34sheet we have around 23 554 and we have
- 42:3925,538.
- 42:40Okay, that's not matching. So with
- 42:42respect to orders aggregate we have
- 42:4513652 here in the database that we have
- 42:49got we have 13314 that's not matching as
- 42:52well. And if you see further, okay, it's
- 42:57adding this 13652 rows. It's it's it's
- 43:00present there. It's simply
- 43:03showing it as null. So I investigated
- 43:05further with this. It seems there is
- 43:07some, you know, intermittent delay in
- 43:09fetching the data. I have reported this
- 43:11to the coordinating team. They are
- 43:12working on it. But I think we should
- 43:14consider this as actual data. Whatever
- 43:17we see in this table as actual data and
- 43:19proceed with our analysis. But folks
- 43:21when you're watching this please know
- 43:23that there is this gap
- 43:24and the idea of this video is to teach
- 43:27you this evolving
- 43:29data analytics tools through AI. So you
- 43:33want to understand this uh AI mindset of
- 43:37doing data analytics. So even if the
- 43:40there is some issue with the data it's
- 43:42okay these are intermittent issues which
- 43:44will get fixed. The purpose is to learn
- 43:47and evolve along with these tools. All
- 43:50right, let's begin looking into the
- 43:52KPIs.
- 43:55Okay, these are the seven KPIs we are
- 43:57going to create. We could see this on
- 43:59the screen and I tried something very
- 44:02interesting with quadratic. I just
- 44:04simply pasted this KPIs there in the
- 44:06sheet without even explaining how to
- 44:08calculate it. So if it has to calculate
- 44:11it correctly, it has to go to the
- 44:12internet, understand this metrics and
- 44:14then create the results. Let's see if
- 44:16that works.
- 44:17I've copied this prompt.
- 44:20So all these prompts will be given to
- 44:22people so they can replicate the same.
- 44:24And we went to the quadratic sheet.
- 44:30Then I just simply pasted this prompt.
- 44:34So I'm going to create a new sheet for
- 44:36this. I'm going to call it like APIs.
- 44:43Yeah. Let's see if that works.
- 44:48It's very interesting, right? It fetched
- 44:50all these results. But how do you know
- 44:52if this is correct? You need to know two
- 44:54things for this. First, you need to know
- 44:55the data analysis because you can open
- 44:57this Python code and check really if
- 45:00this thing is
- 45:02if this code is making sense or not.
- 45:04Even if this code is making sense, you
- 45:06need to have some domain knowledge to
- 45:08understand if the calculation is right
- 45:10or not.
- 45:10Yeah. So, can you explain what these
- 45:12KPIs are? And can you increase the font
- 45:14size so that I can see better and then
- 45:16you explain what exactly is the meaning
- 45:19of these KPIs?
- 45:20I'm going to explain this with a very
- 45:21simple example so that everyone can
- 45:23understand and having this kind of
- 45:25domain knowledge is very important you
- 45:27know especially if you're targeting your
- 45:28career in operations and supply chain.
- 45:30So I've created this very simple table.
- 45:32Just imagine you made an order in
- 45:34Amazon, right? You made it on 19th of
- 45:37May and you made the first order. So it
- 45:39is called as order number one. And you
- 45:41ordered keyboards and you ordered five
- 45:43keyboards, right? The next day you made
- 45:47an order but this time you ordered two
- 45:49items which are keyboards and mouse. So
- 45:52now tell me based on this table
- 45:56how many orders are there?
- 45:58There are two orders right? want order
- 46:00one and two.
- 46:01Yes, there are only two orders. On first
- 46:03day you made only one order. Second day
- 46:05also you made only one order. So there
- 46:07are two orders, right? So that's two.
- 46:10And how many lines are there?
- 46:12Three if you think about it. Three.
- 46:15Yes. So that's exactly the difference
- 46:18between orders and order lines. Order
- 46:20lines will always be more. Orders are
- 46:22nothing but whenever you place an order,
- 46:24it it will get an order ID and that's an
- 46:26order. In each of this order you might
- 46:28be placing multiple items. So those will
- 46:31create order lines. Okay. So now let's
- 46:34understand what is line fill rate and
- 46:36volume fill rate. Okay. So we clearly
- 46:39understood what is order and order
- 46:40lines. Now with the same table let's
- 46:43just expand it. Right? This is the
- 46:45quantity order and this is the quantity
- 46:47delivered.
- 46:49So now tell me is this order delivered
- 46:51in full or not?
- 46:53Yes, because I ordered five and it was
- 46:55delivered five.
- 46:57So instead of writing yes, let's do
- 46:58binary. Let's write one. If the order is
- 47:00delivered in full, let's write one. If
- 47:02not, let's write zero. Okay. And tell me
- 47:06for the second line,
- 47:07no.
- 47:07This is in full or not? No.
- 47:09No,
- 47:09it will be zero. And for the third line,
- 47:12one.
- 47:13This is exactly how it is written in a
- 47:14typical supply chain table as well.
- 47:16Okay.
- 47:18So we have total three lines, right?
- 47:20Line one, line two, line three. Out of
- 47:23these three lines, how many lines we
- 47:25delivered successfully?
- 47:27Two.
- 47:28Two. Okay. Because one and two, there
- 47:31are two. And uh so what will be the line
- 47:35fill rate now? Can you make a guess?
- 47:36It is 2x3.
- 47:38Exactly. So this is line fill rate
- 47:40percentage. It is 2x3 because
- 47:44you have to find a ratio of total lines
- 47:48you've delivered which is two divided by
- 47:52total lines order
- 47:54which is three. So your line fill rate
- 47:56is 66.67%age.
- 47:59So now when it comes to volume fill rate
- 48:01let me make it.
- 48:07Can you make a guess what could be a
- 48:09volume fill rate?
- 48:12M
- 48:15for volume you have to take into account
- 48:17the quantity
- 48:19exactly. So here let's take a sum.
- 48:23So what is the sum of quantity ordered?
- 48:26Right? It's 17. And what is the sum of
- 48:29quantity delivered? It's 17.
- 48:31So the volume fill rate is nothing but
- 48:33the ratio of quantity delivered to the
- 48:35quantity ordered. You just take this
- 48:38number and divide it by this number.
- 48:43So it's 85%age.
- 48:45So that's the volume fill rate. And in
- 48:47supply chain line fill rate and volume
- 48:49fill rate is a very important metric for
- 48:52supply planners, supply planners and uh
- 48:56supply managers and production managers
- 48:59because for them it's very important to
- 49:01know how many lines were ordered and how
- 49:04much they managed to deliver. So this is
- 49:06how the performance is evaluated.
- 49:09And this volume fill rate is also very
- 49:11important for sales people. It's
- 49:13important for supply people but also
- 49:15very important for sales people. When
- 49:16they're having a negotiation or some
- 49:18kind of discussion with the customers,
- 49:20they will say, "Hey, last year you
- 49:22ordered uh 10 million quantities. We
- 49:25delivered 9.98 million. So we we made a
- 49:28you know we almost fulfilled all your
- 49:30orders." because this conversation is
- 49:32directly proportionate to the best deal
- 49:34they can get from the customers. So this
- 49:36metric is very important. Okay, let's
- 49:38move on to two other important metrics
- 49:39which is on time and info.
- 49:44If you expand this table to two more
- 49:45columns, two more information which is
- 49:47agreed delivery date and actual delivery
- 49:49date. So can you now tell me if this
- 49:52order is delivered on time?
- 49:54Yes, because the both the dates are
- 49:55matching.
- 49:56Perfect. So it's one and for the second
- 49:59row it's one as well. for the third R1
- 50:01as well. Okay. So, how many orders were
- 50:04delivered in full?
- 50:05Delivered in full two. We we have
- 50:07discussed that, right? So, two orders.
- 50:08Actually, it is not two orders because
- 50:10if you think about orders, this is where
- 50:12most people make mistake.
- 50:14They think about lines here. In full is
- 50:16calculated at order level, not at the
- 50:18line level.
- 50:19Oh, only one order because order one was
- 50:22delivered full but order two was not
- 50:24delivered full. Was not delivered. Good
- 50:26point. In terms of on-time orders,
- 50:30on-time orders were two. Both the orders
- 50:33were delivered on time. Okay.
- 50:36So this on-time orders it is used by can
- 50:38you guess who uses it in the supply
- 50:40chain field? So there are different
- 50:42supply chain departments.
- 50:44No, I I don't know.
- 50:46Okay. So it is used by warehouse and
- 50:48distribution people. So these are the
- 50:50people who are in charge for delivering
- 50:53the order on time. So you know all the
- 50:56shipments all those trucks going on. So
- 50:58this is managed by the warehouse and
- 51:00distribution people. For them this
- 51:01metric is very important. It's called
- 51:03warehouse and distribution. And this
- 51:06info is again used by supply
- 51:09managers more at regional level. So they
- 51:12want to see this number at a regional
- 51:13level. Okay.
- 51:15Mhm.
- 51:16So now we are going to calculate the
- 51:17most important metric which is on time
- 51:19in full percentage. In supply chain
- 51:21terms it is called as. What if is
- 51:24something very very commonly used metric
- 51:26and for this you can see the data is
- 51:30consolidated at the order level not at
- 51:32the item level. So you see we have three
- 51:34lines here but we here we have only two
- 51:36lines because it's at the order level
- 51:38and you can see the values are also
- 51:39consolidated here for the second order
- 51:41the total quantity is 15 and total
- 51:43delivered is 12. You can see the same
- 51:45numbers here 15 and 12. So at this level
- 51:50this order is not delivered in full but
- 51:52it is delivered on time. So now tell me
- 51:54if this order is delivered both on time
- 51:56and in full.
- 51:58Yes. It's a end condition between E and
- 52:00H column.
- 52:02Yeah. Then it's one. Tell me for this
- 52:05this one is zero.
- 52:06Yeah.
- 52:08So I'll tell you a very interesting
- 52:09point. For one particular order there
- 52:11might be 200 lines. A customer might
- 52:14place 200 items in one particular order.
- 52:16Let's say they delivered all the 199
- 52:18items in full but one line they did not
- 52:21deliver in full. Even they miss one
- 52:23quantity. That order will miss if
- 52:26[Music]
- 52:28it's it's a very harsh metric. It is it
- 52:30is super super harsh. Sometimes the
- 52:32order might have like 200 300 lines and
- 52:34even if they miss one line that order is
- 52:36failed. But that's how it's it's
- 52:38calculated in supply chain and uh so
- 52:41let's calculate the in full percentage.
- 52:42So it's very uh you know very easy to
- 52:44calculate. So now we know only one order
- 52:47is delivered in full. So it's nothing
- 52:49but 1 divided by this value two orders.
- 52:54So it's 50%.
- 53:01And here total on-time orders are two
- 53:04and the total orders are two.
- 53:07So it's 100%. This is super rare in in
- 53:10in the real supply chain world, but for
- 53:12this example, yes, this is possible. and
- 53:15on time and inflow. So this is nothing
- 53:18but how many orders we got both on time
- 53:20and info only one right out of two
- 53:23orders
- 53:28it's also 50%.
- 53:37So this on time and in full percentage
- 53:39is normally used by supply chain
- 53:41directors or supply chain VPs. So this
- 53:44is the metric that they will focus on.
- 53:46They will not focus on any other metric.
- 53:48So this on-time and infill percentage is
- 53:51also called as reliability.
- 53:54Reliability is also a very important you
- 53:56know term in supply chain. So if
- 53:58somebody's asking what is the
- 53:59reliability? If you say 85%age which
- 54:01means 85%age of the times you will
- 54:04deliver the order in full and on time.
- 54:07So the customer will ask you what what
- 54:10is the reliability I can have? If you
- 54:12say 90%age that is really good which
- 54:14means out of thousand orders they place
- 54:16you are sure to make that 90 90% of the
- 54:20times the orders will be always
- 54:21delivered on time and in full.
- 54:24So based on this thing the service level
- 54:26agreements are made and the contracts
- 54:27are dealt and even the you know there
- 54:30are a lot of commercials involved in it.
- 54:32All these things are based on this. So
- 54:34this is also the point where the supply
- 54:36chain folks the sales and marketing
- 54:38folks collaborate. They want this number
- 54:41to be really really high. Only if this
- 54:42number is high, there is a very high
- 54:44possibility of customer retention. There
- 54:45is a very high possibility of getting
- 54:47better deals and all this stuff. I
- 54:50always wonder when I order things from
- 54:52Amazon like how how well they take care
- 54:55of this entire supply chain because they
- 54:58order things from China and here in my
- 55:00home in US when I order things get
- 55:03delivered on a very next day and by
- 55:06learning all these domain concepts now
- 55:08I'm kind of getting better understanding
- 55:10of their inner world
- 55:12on you know companies like Amazon would
- 55:14have very strict
- 55:16uh uh strict rules on on metrics like
- 55:20Otif
- 55:22and their suppliers will have to have
- 55:24very high like you know high performance
- 55:27when it comes to percentage etc. So I'm
- 55:30really glad that I'm learning this
- 55:32domain concepts because in the world of
- 55:34AI where technical things are being
- 55:37automated the knowledge of these domain
- 55:40con concepts is something that can set
- 55:42you apart from the competition when it
- 55:44comes to job market and career growth.
- 55:47Yes, Amazon is a good example. So,
- 55:48reliability is one important metric
- 55:50where you always promise to deliver like
- 55:52a perfect order with which is on time in
- 55:55full with perfect documentation. But
- 55:57there is also another metric which is
- 55:58like the the response cycle time like
- 56:01when you place the order or the order
- 56:02fulfillment time. So that is something
- 56:05which Amazon worked on. Earlier it used
- 56:06to be like three or four days in in the
- 56:08e-commerce world. Amazon made it like
- 56:10same day, one day and now you see hyperd
- 56:13deliveries which is happening in like 15
- 56:14minutes, 10 minutes and all those
- 56:16things. All this is based on this metric
- 56:18and uh so what you spoke about is an
- 56:20example of B2C where a business is
- 56:22giving directly to the consumer but this
- 56:25this particular concept is mostly tied
- 56:27to B2B where there is one company which
- 56:30is having a lot of distributors and who
- 56:32are having their consumers which makes
- 56:34the supply chain even more difficult
- 56:35because they also have their supply
- 56:37chain. they have to maintain their uh
- 56:39you know they have to maintain the
- 56:40promise to their consumers and it it
- 56:42gets very long and most of the times
- 56:45this company is also procuring from some
- 56:47places like China and you know this is
- 56:49why right like uh if you are getting a
- 56:51product in your hand this mouse if
- 56:53you're getting it today it it is
- 56:55probably planned like some 300 or 400
- 56:58days before before it comes to your hand
- 57:00so that's that's very interesting that's
- 57:01why I love supply chain it's is a very
- 57:03interesting field
- 57:04many of the people who are watching this
- 57:06video are the uh customers of uh you
- 57:10know things like Blinket, Zomemetto,
- 57:14even Flipkart and all these companies
- 57:17even though it's B2C internally they
- 57:19also work with their their business
- 57:22partners. So now you all are getting
- 57:25some insights into that beautiful world
- 57:28of supply chain.
- 57:30Great. But supply chain is super vast.
- 57:32If uh if folks you're watching this
- 57:33video, if you're more interested, try to
- 57:36uh you know type SC score on in Google
- 57:40and uh search for this. It's supply
- 57:43chain operational reference model. It
- 57:45has a lot of interesting concepts. You
- 57:46can you will definitely like it. Okay.
- 57:49Now let's get back to this quadratic
- 57:51sheet and check the formulas. I would be
- 57:54really surprised if it has calculated
- 57:56all these formulas correctly because we
- 57:58gave no reference. Right now you know
- 58:01the supply chain concepts. You can also
- 58:02validate this along with me. Let's first
- 58:05check the order lines. So it says
- 58:09calculated from the fact order line.
- 58:13So yeah total order lines is nothing but
- 58:15the length of order lines. What is order
- 58:18lines? It has calculated it from the
- 58:21order lines. It has went to this table
- 58:25and it has calculated this which is
- 58:27correct. This order line table contains
- 58:29all the orders. So it did not take the
- 58:31unique value of dollars. So it knows
- 58:33unique value of orders means total
- 58:35orders. Order lines means it has to take
- 58:37the entire order lines. So it is
- 58:39correct. And let's see total orders. So
- 58:42it says total orders is nothing but
- 58:44length of order aggregate. What is order
- 58:47aggregate? Okay. Oh, that's really good.
- 58:50It somehow understood this fact
- 58:52aggregate table contains a consolidated
- 58:54order. If you are wondering just just
- 58:56remember this example right these are
- 58:58order lines then I consolidated it right
- 59:01two orders this is the same example here
- 59:03here we have all the order lines and
- 59:05this aggregate is nothing but
- 59:06consolidated orders so it it it did a
- 59:08really good job there I'm I'm quite
- 59:10surprised and
- 59:13so let's see the line fill rate so again
- 59:16it's using the order lines table and in
- 59:18this it is calculating where the values
- 59:21in full is equal to one which means the
- 59:23orders which are delivered in full which
- 59:26are delivered in full quantity and it is
- 59:29dot mean it means it's it's it's a ratio
- 59:33it's it's basically dividing that value
- 59:36with the rest of the values which is
- 59:37correct. So it it's taking a ratio of
- 59:39values that is one versus the rest of
- 59:41the values which is zero. So this
- 59:44calculation is also right and the same
- 59:47thing goes with volume fill rate that is
- 59:50that is also correct. So it calculated
- 59:52the total delivery quantity with the
- 59:54order quantity sum. That's perfect. And
- 59:59with the on-time delivery yes it has to
- 1:00:01see on time and in full and all these
- 1:00:04three things has to be calculated at
- 1:00:06order level. So you see it uses order
- 1:00:09aggregate table which is nothing but the
- 1:00:12consolidated order level. I'm I'm really
- 1:00:14surprised that this is able to calculate
- 1:00:16it so accurately without us giving an
- 1:00:18external references. This is this is
- 1:00:20good. If you're not using AI tool, you
- 1:00:23would have spent few hours and now you
- 1:00:27you did all this work in few minutes. So
- 1:00:30you can realize the productivity gain
- 1:00:32here.
- 1:00:33Yeah. But this also reinstates the point
- 1:00:35that you cannot miss the fundamentals,
- 1:00:37right? Let's say if you don't know the
- 1:00:38supply chain concepts, if you don't know
- 1:00:39the basics of Python, you won't be able
- 1:00:41to validate this code. You would have
- 1:00:43given this to another AI to validate,
- 1:00:44but you don't know even if that is
- 1:00:45correct. And this will go on. So you
- 1:00:48need to know the basics and you can kind
- 1:00:50of you know maximize your productivity.
- 1:00:52That's how I see using the ZI tools.
- 1:00:54AI models will hallucinate on occasions
- 1:00:57and if you are you know deploying this
- 1:00:59code to production or using it to make
- 1:01:02important decisions. It is important
- 1:01:06that you know the fundamentals. So you
- 1:01:08all might have a question of should we
- 1:01:10learn Python? Should we know uh data
- 1:01:13analytics? Should we know domain
- 1:01:14concepts? Yes, of course you need to
- 1:01:16know because you are the one who will
- 1:01:19validate if AI generated correct output
- 1:01:22or not and it will make mistakes folks.
- 1:01:24See right now it did a good job but
- 1:01:28let's say one out of 100 times it is
- 1:01:30making a mistake then that mistake can
- 1:01:32cost your company a big money. the
- 1:01:34company will hire you because you know
- 1:01:36all these fundamentals and you can work
- 1:01:38with AI and you can figure out its its
- 1:01:40mistakes and you can fix it and you can
- 1:01:42also guide AI you know typing that
- 1:01:44prompt and you can guide AI to do the
- 1:01:48right thing
- 1:01:50okay now we have seen how to create
- 1:01:52these KPIs right so next why don't we
- 1:01:55ask some business questions and see if
- 1:01:56it is able to answer it properly
- 1:01:59one thing I'm curious about is if there
- 1:02:01is a way to track monthly on-time
- 1:02:03performance months.
- 1:02:04I mean, yes, I think it should be able
- 1:02:06to do, but let's see how it is
- 1:02:07responding, right? I'm just simply going
- 1:02:09to ask uh show me monthly
- 1:02:14on time performance by cities.
- 1:02:18Mhm.
- 1:02:20Cuz uh if you're a VOS and distribution
- 1:02:22manager, you would like to know it by
- 1:02:23cities.
- 1:02:25And let me do it in a new sheet.
- 1:02:28I'm going to call it
- 1:02:30business questions.
- 1:02:35you press enter.
- 1:02:39Okay, it generated a chart. I think
- 1:02:41that's pretty good from this. I can
- 1:02:42easily see how the trend is declining
- 1:02:45and uh it's showing me pretty good like
- 1:02:47how I would expect to get created in a
- 1:02:50PowerBI or something. That's that's
- 1:02:52good. So maybe I can ask more questions
- 1:02:55to it like uh I've created a prompt. Let
- 1:02:58me open it. So I want to ask like show
- 1:03:00me the top five customers based on their
- 1:03:02order value and their on-time percentage
- 1:03:04in full percentage on time in full
- 1:03:06percentage. I want to say also add the
- 1:03:08customer name, customer ID and city in
- 1:03:10the table. So let's see what it
- 1:03:12provides.
- 1:03:13I'm going to copy this
- 1:03:15and folks you can mention uh in a prompt
- 1:03:18if you want chart or a table.
- 1:03:21you. Can I just read this one more time?
- 1:03:31Okay, I pasted the prompt here in the
- 1:03:33chat window and uh let's see what
- 1:03:36happens.
- 1:03:39And wherever you have active focus in
- 1:03:41the sheets, see you have it at row
- 1:03:43number 26. So I think that is the
- 1:03:45location where it will insert the the
- 1:03:48new visual.
- 1:03:50Yes. Okay, you can see it generated the
- 1:03:52data here and uh it did not generate in
- 1:03:55the line 826. It generated you know
- 1:03:58somewhere randomly wherever
- 1:04:01and uh that's good. It just gave me
- 1:04:04everything what I wanted. It gave me the
- 1:04:05customer ID. It gave me the customer
- 1:04:08name, city, total order value on time
- 1:04:13info percentage in full percentage and
- 1:04:15on time percentage. Let me quickly check
- 1:04:19the code. Okay, it's taking the fact
- 1:04:21summary for this which is good. So if I
- 1:04:23quickly skim through this code, it looks
- 1:04:25good. But if I have to do this for real,
- 1:04:27I would I would spend some time with
- 1:04:28this. I would spend another 10 to 15
- 1:04:30minutes in this to check. But at the top
- 1:04:33level, it looks correct. Yeah, I think
- 1:04:35uh that's pretty much good. But as for
- 1:04:38you know like uh here I ask for top five
- 1:04:40customers. It seems all my top five
- 1:04:42customers are in US. So let me copy this
- 1:04:45same prompt here and see if it is
- 1:04:48consistent. I'll put it here and say
- 1:04:51show me top five customers in India.
- 1:04:53I'll just add one more line here
- 1:04:56and see what result it provides.
- 1:05:02I think that's very consistent. It gave
- 1:05:04pretty much the same results but with
- 1:05:07Indian customers. That's good. That's a
- 1:05:08good summary table.
- 1:05:10Yep. Looks amazing. You just type a
- 1:05:13prompt and it is doing most of the work
- 1:05:15for you.
- 1:05:16Yeah, I I I mean it's it's amazing. But
- 1:05:18at the same time, I would say this also
- 1:05:21reinstates the point to me. The
- 1:05:22fundamentals are very important. You
- 1:05:24cannot simply work with a tool like this
- 1:05:26without knowing the fundamentals of
- 1:05:27Python coding or knowing about supply
- 1:05:30chain. Not having any domain expertise,
- 1:05:32it's not going to help. That's why we
- 1:05:34always stress that having domain
- 1:05:35knowledge and having the fundamental
- 1:05:37understanding of this coding really
- 1:05:39helps a lot. Okay. I highly recommend
- 1:05:41you to practice this along because
- 1:05:42quadratic is free. They provide some
- 1:05:45free AI credits. There is no excuse for
- 1:05:47you. You need to practice this. And they
- 1:05:51also promised the quadratic team also
- 1:05:53promised to provide some special
- 1:05:54discount for the learners of this
- 1:05:56channel. We are putting that in the
- 1:05:57description. You can use that and get a
- 1:05:59special discount if you are taking a pro
- 1:06:01account. So like I said, please do
- 1:06:03practice and also know that this is not
- 1:06:06the end, right? There are a lot more to
- 1:06:07explore, a lot more to learn and we are
- 1:06:09planning to bring more videos of this
- 1:06:11kind where we are just going to provide
- 1:06:13a very you know unbiased and neutral
- 1:06:15view of the tools because they are in
- 1:06:17the evolving space. We just want to
- 1:06:19break down the hype and show you the
- 1:06:20reality and I hope you found this video
- 1:06:23really useful.
- 1:06:24This is the end and I want to mention
- 1:06:25very important thing which is exercise.
- 1:06:28In the video description below when you
- 1:06:30click to download files you will find a
- 1:06:32file called exercise.pdf.
- 1:06:35Please look into it and work on that
- 1:06:37exercise. If you have any questions,
- 1:06:39there is a comment box below. If you
- 1:06:41like this video, please give it a thumbs
- 1:06:42up and share it with your friends who
- 1:06:44are learning analytics and AI.
- 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.