In this video, we will learn about index function in poverty and the practical use of the index in
the real life project.
So it is very important video.
And please watch Dylan and you will learn a lot of useful tips and tricks.
So here I took one dataset from the court cases.
So here you can see there are we have four countries under different countries and then we have a dead
column dead confirmed and recovered cases and we are interested in confirmed cases.
So let's do it step by step.
So the structure of this data set is we are having confirmed cases.
So we have a running total of all the confirmed cases right in this.
We don't have any information on the level.
So first of all, we are interested in the confirmed column and confirmed column, dead column and the
country column.
So then we can just remove the other columns.
And because it's very big, they're the size of this file is very big, so we don't need to render everything.
So in this to the SEC, we are only interested in, for example, us.
We just need to frater us.
And here we have all the data that could belong to us.
So here you can see.
On the 22nd of January, we have one case than twenty third, we have again one, for example, if you
look here, 3rd of March, we have one one eight.
Guesses.
So what are the actual guesses on 3rd of March, it will be one one eight minus 98, right?
So we need to assess the value from the previous role, so.
For example, if you look here, 98, the record is a 41 year old and the index is 440, right.
Because the index start from the 08.
From the position so how we can access this value, this record is very simple, we just need to click
here effect's.
And then we have to write in the curly bracket 40 write it to.
And here you can see we record this record us unauthenticated is finding confirmed the number of cases
98, but we are only interested in confirmed cases.
So what we have right here, the name of the column is a confirmed.
So a record 98.
So if I copy the whole Syntex here.
Copy and.
Then I just need to delete custom and we need another column so that we can display value in a separate
column.
So what we will do, we need to add column, custom column, and you can write any name here and here.
We need to paste.
Right.
So let's get.
And here you can see the Ninety-eight is being repeated with every rule.
But what we need the same value as we can see in the current column, we should get the same value in
the custom column.
So we need something like incremental op ed here, just like we do in the if she knows some other programming
languages, the to develop and like in follow there is like is equal to zero is less than 10 and a plus
plus.
And then we put the incremental pressure here.
So we need some kind of incremental operator here.
So what we will do here, we just need to delete add column because we don't need to repeat the same
value with every.
So we will delete it.
And there is one function like index column so we can apply this indexed column from like from zero
to onward with the incremental one here you can see it is a zero.
Let me show you in the if you click in the setting.
So here you can see the starting index is zero and the increment is one.
So we are getting with every increment.
For example, if we need to increment one or two or three, then it will show values accordingly.
If I say, OK, we need only increment of two, we will get zero two, four, six and so on.
But we are interested in only increment one, right.
OK, so we have incremental operating here and now try to get the same.
So now we need to add one more column, custom column, for example, and we can again copy and paste
the same expression that we had copied.
So this is the name of the previous step and then the calibration that which record we want to get and
from which column.
Right.
So, you know, this this whole thing text.
If you don't know, you can watch my previous video, Barclaycard's.
So here we need to.
Instead of 40, we need to get this value dynamically.
So I need to access one field here.
So which field I need to access this fund, this index field, so how we can get in field from the from
the table, that's a square bracket.
And you can see index and it will start from zero.
Here you can see zero one, two, three, four.
First of all, it will qualify for the zero and we will get the record from the zeroth position, then
one, then two and three.
So because everything that we write here and our custom column, this expression repeated with every
rule.
Right.
So we need to click.
OK, so here you can see we are getting exactly the same records as we can see from the confirmed column.
Right.
So this is like if you see here, one one eight, we are getting it.
So we are interested in the previous value.
Right.
If I say OK in the custom column, instead of getting value from zero to index, if I write here first,
then let me assume it.
If I write here index minus zero.
Then a zero three zero minus one, it would be minus one and we will get nothing right.
So and then it will go for the like for the fifth, first and then the fifth minus.
One they fought for will always get the value from the previous.
All right, so we just need to confirm.
So here you can see now we are getting of 60 in front of 60.
We're getting 58 the previous four.
Then again, 74.
And then in front of 74, we are getting 60.
It is humid and you can see better than 98 inverted previous value 74.
And here you can see previous value is 74.
So we got one issue here.
This is one error because there is no value available on the index, minus one.
So what we can do here, we you have seen my my video of our error handling so we can, um, use here
try if you don't know about this thing, you can maybe watch my video and you can see different ways
of error handling and try and see if it is error.
Otherwise
then I will display it.
Or I can right here, for example.
Zero.
Zero and a confirmed.
So we can rename this column.
Like previous
previous cases.
And if I add one more column, because some column.
And the Huracan flight delay case is.
And I can confirm minus previous cases there, so.
OK, OK, so here you can see on this date, we are having only one case and.
Just a minute here.
OK, so here you can see we have private cases and delicacies and on the twenty third of January we
have again won cases.
So there is no change and we are getting zero because there was no new case on twenty third of January.
Right.
And then again on 24th of January, we have two cases because they are an intruder and two minus one
one.
So we are having one in the same way.
Uh, you can watch here like in the first of March we are having seventy four point seventy four minus
sixty eight on this date.
We have total cases, six seventy four minus sixty eight.
It will be six.
So this is so in the spirit you have seen with the help of Index Collum, we can easily get the value
from the previous.