Transcript for:
Exploring Obsidian Data View Plugin

in this video I'm going to go through the data view obsidian plugin which is a plugin inside of obsidian that queries your files so obsidian is essentially a big folder and data view let you search for specific files using filters using sorts and using any other expressions or functions so things to filter down what files you see in lots of different ways giving you lots of flexibility but it can be confusing hence the video for a bit of orientation you can see this is a new Vault so the main Vault folder is called Data View explainer and then inside that I have a data folder with two files me and then my podcast co-host and then this example file which is outside of the data folder and I'm showing it twice in this left view if I click on the three dots you can see it's in Source mode what that means is if I push hash and then say header this is markdown but when I push enter I can always see the source code so I I can see the hashtag whereas in this other view of the exact same file so this is the same file this one is in live preview you can see it's not in Source mode and it shows what it's meant to be if I get rid of this hash it's going to show the text and the reason I've done that is so that we can see what's going on in the query and what it actually shows when it renders going going to go bottom left settings go to the community plugins and what I've done is I've browsed for a community plugin I've found data view I've installed it and then inside of the settings so you can see I'm in the data view obsidian plugin settings I've enabled inline queries enabled the JavaScript queries and enabled the JavaScript inline queries everything else kept exactly the same all default so now when I push these three ticks on my keyboard you can see we've now created a code block and in the right side it's going to show a code block which you can copy to your clipboard by typing data view you can see it's turned the code block into a data view query but there's a data view error passing failed in other words there is something inside the data view query that doesn't work and it says the expected error is that I haven't put in a type of query result quickly looking at the settings you can see there are JavaScript queries and then there are normal default queries and you may see things referred to as dqls so data view query language or dvj which is data view JavaScript the moment this code block is dql because it's the data view query language however if I put JS at the front of that this is now data view JS and this uses JavaScript inside of the queries so sticking with the dql the data view query I'm going to type table because that's the first type of result I can show and now it's showing a table of my entire Vault so we've got the Danny Hatcher file the John Stewart file and the example file in inside of this data view explainer Vault and what the query is showing is all three of those files if I was to change this to a list it's going to do the exact same thing but you can see now there's a bullet point and it's showing a list if I change this to task at the moment it's going to say there's no results because there are no task blocks inside of this Vault and inside of obsidian there is marked down for that which is a bullet point with some square brackets in between so now I've added a task to the file you can see it's tickal and now it's going to show that inside of the data view query because it's looking for all of the task blocks so if I add a couple of tasks you can see the query will update and say first task second task and it will find them all and then the fourth type is the calendar but this is limiting and can be kind of buggy as well when you get into using other things so I personally would avoid using the DAT of view calendar and use another plugin for calendars inside of obsidian now going back to our table a table has columns normally and at the moment there are no columns apart from the main ID which is the file and then showing the three files and because this is only showing a table it's not a table in itself it's a result we need to create the columns or the field information inside of the file and going to the data view help documentation going to the data types you can see there's a field type section and if we look down the right side you can see all of the different types of fields there can be a text field a number field Boolean date duration link list and then object if I click on my name and I go to the file you can see here this is a property this is one of the properties inside of obsidian and this is a field do OB as date of birth and when I click on the icon you can see property type we have text list number checkbox which is the boing field type date and data and time the data view link option is inside of the default text properties and at the time of making this video the obsidian object field isn't available inside of the properties in this view you would need to go into the source mode and then add it the reason this looks out of line is because I've zoomed in so you can see the text which is obviously confused obsidian a little bit but in addition to these main properties and these main field values at the top of the file the data view plugin also let you use in line so these are inside of the file you can collapse them and open them but you can have inline Properties by typing words then using two colons and that is going to be the value so the terms used by data view do o is the key and then the date is the value country is the key at the moment the value is empty color is the key blue and orange is the value so here inline is the key and now hello becomes the value so if we jump back to our table if we type in a key if I type in d o cuz that's the key it's going to show the value so you can see the date of birth of both of these people is actually the same date and when we have a look at the file you can see the key is do so that's the key here and then the value is the actual date and when we take a look here remember inline is the key hello is the value so if we come back here type in line you can see inline is is now the column key and then the value is the actual information and data view also lets you use inline values within words within sentences you can see Danny Hatcher in the source mode there's the key there's the value and this is the Syntax for properties and then this is an inline so you can see I've got the square bracket to start square bracket to end and then the two colons in the middle this is inline information which shown in life preview or in the reading view you can see we've got the properties which have rendered properly as you would normally see and then this has some highlights on it because this is information data view can see which you can come in and edit and when we go back to the table it doesn't impact anything because the key and the value are still accurate even though it's inside of the sentence now something to be aware of is because data view likes to have what it calls sanitized metadata so information it can see what it will do is it will connect words with dashes remove bolds and other syntax so you can see it's removed the capitalizations and it's added it all together as one sort of long string and if you add any bolds or italics or anything like that it will also remove it to sanitize that information and what that means is when we look at this key so that's capital d o and then we look at this key there's a capital I and then in line inside of this file we can see all that information is accurate and when we show this table query this is the capital I which was accurate and it's showing hello if I change the capital to a lowercase so now we've got in line it's still showing hello if we type in lowercase d o it's still showing the date of birth even though we've got the Capitals in there which makes it easier to keep things going so it doesn't sort of like cross over anything or forget anything or leave anything out but these fields aren't the only Fields you can use for data view there is also a long list of of what they call implicit Fields so these are fields that are already built in with data view so file. name file. folder they will reference specific things in obsidian that you don't have to add so if I type in file doc time that's the created time of the file inside of the table it's going to show the created time of the file and that is an implicit piece of information however when you look at tasks and lists instead of tables that's a type of view there are different implicit Fields because in a task there is a status of a task whether it's ticked or not so checked completed fully completed so you can actually check different implicit values with a task query when compared to a table query so if I type completed inside of the table query it's not going to show me anything because inside of the Danny Hatcher file there is no key that says completed and there's nothing implicit for data View to show however if we look at a task query so we've got one task that's uncomplete and one task that's been complete you can see there's the tick box and I can tick this and it would change it to put an X in it or not now I can ask the task query where it's completed and where is a way to filter this query for implicit information I.E it's completed or not now just as a quick point you can bring tasks into a table view so you can see I've got a table and then I'm referencing file. task tasks. text and then I'm calling this text so that's the text of the task so task and then task two but I can also add in the completed variables inside of this table so it's not unique to the task query but the task query does mean you don't have to do all of this dot stuff which I'll explain later on with the flatten and group buy so it is doable inside of a table query but in my opinion it doesn't look as clean and it adds a bit of complexity that you may know what to deal with and in this case I can put an exclamation mark to say not so now it's looking for tasks where it's not completed completed using implicit information which is showing the task that hasn't been complete now coming back to the data types quickly text you can look for Words inside of the value so we've got the key then we have the value text you can look for words but a number you can't look for words but you can do arithmetic so depending on the data type will change what you're able to do booing you can check to see if it's true or false but numbers is not a true or false because they could be lots of different numbers in there positive decimals Etc and we need to bear that in mind when we're doing queries because if I'm looking for something that is true or false and comparing it to say a number well I can't say a number is equal to true or a number is equal to false because they are two different data types so now let's have a look at the data View structure a query structure you could add a task type which is what we've done we can add task and it will show all of the tasks and then add in something underneath we could add a list type and that shows the bullet point list and add one field so I can put date of birth but it doesn't let me add another field you can see I've got list date of birth and VIP so these are two different fields and it's showing an error and it's pointing to the error which is the comma VIP is a key and it has a value but because the list type doesn't let me have two Fields it's showing an error however if I have a table I can have as many field types as I want so the list is showing the error if I change list to table it's now going to show date of birth and VIP as false then you have from which lets you specify where you want it to search from so it gives you a source at the moment we don't have anything in the from so data view is assuming it wants us to search everything which is why it's showing these three files bear in mind that the from needs to be after the type of query the rest of these can be moved up or down but if the from has something before it data view won't use this from argument but if I type in from it's throwing an error because I haven't told it where to search from looking at the data commands inside of the data view help docs it shows you how to use from how to use where sort Group by flatten limit all the other commands we're going to use and you can see we can search for tags folders single files links and that's links to or from so if we have a look at the Danny Hatcher file at the moment there is a tag that says example so if I want tag from hashtag example then come back to the table it's now filtered my table view to look from the files that have hashtag example in it if I remove the tag from Danny Hatcher and back to the table now there are no files that is from # example when I add the tag back go back to the query it's now showing my file I can look for the data folder so I've used speech marks put data in the middle because data is the name of this folder and it's showing the two files inside of the folder Danny Hatcher and John I can rightclick create a new folder me put myself in the me folder and now if I want to look for just me I can go slash me so now I'm looking for data and me so I'm looking for the files inside of the me folder not just the data folder or I can remove the folder and look for just this file name and what I've done is I've added the entire file path so I've said look for the data folder and the file inside it called Danny Hatcher and now it's showing just my file now at the moment Danny Hatcher doesn't have any links going to or from it so if I go Square bracket square bracket and Link it to John so now I have a link from Dany outward to John and if I go to John there is no outward link to Danny but if I look to the right side and see the back Links panel there is a link from Danny to John which is the one we've just made you can see go back this one's out from Danny to John and this one's back from Dany to John so inside this data view query type bracket bracket John Stewart it it's looking for files that go to this note and we have a link that goes from Dany to John so this is looking for the back links but if I want the outgoing links I surround it with outgoing and then Open Bracket close bracket and because there's no outgoing link it's not showing anything so I add Danny Hatcher now there is an outgoing link from Dany to John which the core obsidian plugins actually already show so 's the back links and there's the outgoing links on John there's no outgoing links but there's a back link on Danny there's no back links but there is an outgoing link you could then combine these together to be more specific so I'm looking for files from the data folder so example is not going to show and has hashtag example so it's going to show me because I have the hashtag but John doesn't I could then say from the data folder and not by putting a minus before this so this is not got the hasht example and now it's showing John I could say anything that is not in the data folder by doing the same sort of thing by putting a minus before that so now it's showing example because that's not in the data folder I could then look for anything that has a hashtag or as the file path example so I'm now looking for the example hashtag or example so we've got the Danny Hatcher because it's got the hashtag and the example because that matches this file path now we have the wear condition and this allows you to add expressions or more advanced filters rather than just a source so looking at this because there is no from it's looking for the entire Vault and I've added where but it's giving me an error because I haven't put in an expression so if I type in a key do that is a property field key it's now looking for where there is a do a date of birth as both of these files have a date of birth they are going to show show so where shows positive results where this expression is true if I put an exclamation mark in front of this it's looking for where there is no date of birth and the example file doesn't have a date of birth so it's going to show inside of the query and this is where understanding data types is important if we go to the Danny Hatcher file we've got a number if I add a number in here say 27 and I say where number equals 27 it's going to be true but if I put 27 as the country and say is country equal to 27 country is text and if I come back to the query it says no there isn't anything that matches this this isn't true but it is because 27 is there but the difference is this is being told to data view as this is a number this is text so I need to put this into speech mark to say to data view this is a string this is text you're looking for and now it's going to find the file and if we go to the top right of the file click the three dots go into the source mode you can see this is how obsidian is telling data view that information so this is text whereas this is a number so it's inside the source metadata of the file not just data views just knowing it implicitly so when we're looking at data view expressions and we scroll down you can see we've got the field expression type and there are literals which are constant values things like one hello and anything you've written in so when we put that 27 in speech marks we were creating a literal and comparing it to a key country being the key 27 being the literal that we were looking for you can do arithmetic but bear in mind that if you're trying to do arithmetic or math with numbers it will work but when you do math with words it won't so as a basic example we've got a query looking for everything and it's doing 27 add three and it's doing that calculation inside of data view to give us the number but when we ask it to do 27 add three the word three 27 is a number three is a word data view says I can't do that and then when you try and add words together it gets confused because it doesn't know whether this is one key this is another key and this is another key or whether it's all meant to be one which is where we need to put speech mark around the entire key so data view knows okay all of this is meant to be together this is meant to be all combined which is 27 + three you can still use the plus as a way to combine different numbers and text together but you can see you need to tell data view what's what three is a string so I've surrounded it with speech marks and then 27 so the plus is concatenating or putting them together so now we have 27 add three and that is being the it's not the calculation but that's what's happening so if I put space in there you can see now 27 and three are together and if I replace 27 with the words inside of speech marks I now have this string concatenated or added to this string which leaves me with this and you can use the arithmetic inside of any part of the query so when we come down to comparisons you can see price is greater than or smaller than a number Price being a key inside of obsidian files 10 being a literal number and then the greater than sign being used inside of the where Clause so looking at our example we've got a table we're showing the number field value so there's the number there's 27 where the number the key is bigger the comparison operator is bigger than zero well 27 is bigger than Zer if we want numbers that are smaller than zero change the comparator well now we've got John Stewart which has no number an example which again has no number so it's smaller than zero and you can do that with the implicit values so they can be dates durations any other information you can add inside of obsidian I've previously mentioned also adding in list and object indexing so when we have a look at the color key that's the color field at the moment it's a list field so we have blue and orange as two different values so they are list values and when I look for table and color it will show both of those different values inside of the column and if I add square brackets at the end of this key and say zero I want it to show the first value of that list or array so when we go to Danny Hatcher the first one is blue go to the example the first one is showing is blue because it starts at zero then to one so if I go to one it will show the second value in the list go to Danny Hatcher orange is now showing the second value if we go to number two well there isn't three so it's not going to show anything so you can look for anything inside of the list value then we get on to functions now inside of the obsidian documentation you can see there are lots of functions I will go through a couple of them later on and I may show some examples later parts of the video but there are loads of functions that you can add which do lots of different things which is where much of the complexity and flexibility and extensibility of this querying language can be used which obviously adds complexity but goes beyond a lot of the other query languages that other apps use so I'm going to use a wear clause and I'm going to use the function contains and when we look at the contains function you can see you can look for an object a list or a string and then you input a value so very similar to the key so any sort of key in there and then a value here so if I go to the country of Danny Hatcher add UK this is text I've now added contains the key being country because that's the key I'm looking for comma and then I'm looking for text so I'm using speech marks and then UK as the value because I want everyone where the country contains UK and so now it's showing me if I now go over to John and add UK in for John go back to the example table you can see now John is showing because J's country key contains the value of UK lambdas can also be used inside of Expressions as advanced literals often in of functions that are kind of complicated which I'll touch on in a couple of later examples and then you can also index through links I personally haven't found a use for this but if you put a link then use dot then use the key you can find values from a link inside of the data view query we then have flatten which then creates a row for every True Result inside of a query Doos one of the data view helpers inside of the obsidian Discord explain this to me as it's like creating a new key new property new piece of metadata so when we look at the color key and we look at the two values blue and orange this is one piece of metad dator it's one property but if we flatten the color each of those values has now been created as its own individual row so you can see John showing up twice because the value is now its own piece of unique metadata sort of and good practice is to name what this is because it's not labeled anywhere which is what the as F is for but now that I've renamed this the table is confused because it's looking for color so it's showing the color and then splitting them up with accordance to the flaten C so data view recognizes that John has two c colors it has two colors so it's showing two results but the table is showing color so it's showing both of those results which means I need to change what the table is looking for because the table is actually meant to be looking for C so now it's showing the individual result rather than all of the results through color and then you can add a wear Clause after the flatten so you can see I'm looking for all of the files where there are lists so the example has a list which is a bullet point that could be a numbered list as well and I'm flattening to file. list as l so L becomes each of these different New pieces of metadata we've sort of created with flatten but then this wear after the flatten is looking for anything that contains l. text so text inside of L that is hello so if we have a look into the Danny Hatcher file you can see there is a list point and it says goodbye in here we've got it filtered for hello if we remove this line you can see now it's looking for goodbye and hello because that's the text that we've got in here it's showing all all the files lists it's done that but to add the wear Clause it then filters out specifically for what we flatten so that's why you'd use a wear Clause after a flatten and potentially one before it but the group bu does quite literally the opposite of flatten it groups I brings all of the files together so I'm grouping by date of birth so every file that has the same date of birth will appear in date of birth but because all of the files have now been condensed into one one result date of birth I need to find the rows again so I need to type rows Dot and then the information I want to see in this case I want the file link so you can see John and Dany both have the same date of birth an example doesn't have a date of birth and you can look for specific keys so I'm looking for the color key related to the date of birth so you can see this dot represents a file but I'm not showing the file and then it's showing the color this dot represents another file which I'm not showing and then the color and looking down here we then have sort so I can sort by number so I'm looking for the number key in ascending order so we've got 14 then 27 or a descending order now we got 274 now you will have noticed because the number here is essentially zero when you go to ascending order it's always going to show something with no number at the top which is where you can add a filter that says where there is a number so if there is a number it's going to show if there isn't it's not going to show and I'm sorting that by number ascending which is there and again if I go to descending we have it there if I was to put exclamation mark it brings in example and now the sort kind of becomes redundant because they're all going to be zero now if I go to John you can see he is in the UK but I've changed myself so I am now from Germany so country Germany and then John country UK what I can do is add a custom sort and this is where it gets a little bit more complex so I have a function default then I'm using a Lambda so X is there and X is down here and what essentially I'm doing is asking if it's UK give it a value of one if it's Germany give it a value of two and what I want you to do is look at country so that's the key and the value are here so the values UK and Germany are here the key is down here and this is the other and I want you to order that in ascending order so UK 1 Germany 2 and when we look at the table you can see UK is 1 Germany is two if I was to change this to descending order the example's gone back to the top because it's at 99 and Danny Hatcher Germany is there and UK is there so if we go ascending and change the UK value to two and the Germany value to one you can see Germany is now at the top and UK is now second and you can add as many as you want so I can go colon USA 3 now I don't want to put a colon because that's going to close this out so USA is now three so Germany first UK second and if I was to add a new person so got new person the country is from USA you can see USA is three so Germany is one UK is two and USA is three and this is a custom sort which you can of course add all of the other from where flatten Group by sorts on top but what if you don't want to see all of the results well you can limit it by putting limit and then say two so now it's limiting the results to the top two and if we were to change this to a descending order is now showing the top two of this sort and you can limit this to as many as you want now unique to the table view is these columns because inside of the list view you don't get any columns so when we're in the table you can rename these columns inside country I could say as state so it's looking for the country key in inside of the files but it's naming the column as state the first reason this is useful is because we can remove this First Column by adding without ID so it's removing the ID of the data view query but I still want a First Column with the link so I can add this back in as just a column file. link and then make sure there's a comma because I need to separate these two columns now I want to name file. link I don't want it to be that as name so now I have a First Column of file. link and I've renamed it to name so instead of showing all of the calculation stuff that data view is doing is just saying something quite nice but if I say name of person because there are spaces data view doesn't know whether these are individual keys again I'm going to put quote marks around them to say name of person is the name of this column something else you might want to do you can add a function anywhere inside of a query so I'm going to use the join function put a bracket and then close that out so now I've joined the list of color together so now blue and orange is a joined list rather than the bullet point results it shows by default but now my column doesn't look very nice so I'm going to rename that as color so now I have color as the column title and it's joined the color key to make it look better now for for VIP that's a Boolean so if I tick this we go to example column VIP we've got true or false but I want this to show an emoji so I'm going to use a different function inside of this title and say Choice open the brackets so it's going to look for the key value VIP but now I need arguments I need the answers of whether it's true or false you can see I've got Choice I've got the key VIP and then at the moment I have the words true and false being shown which mimics exactly what it's supposed to so we've got John Stewart and John is true it's correct but I want this to be an emoji so I can go into my emoji menu on Windows that's Windows dot on Mac I think it's command shift space uh I can add in those emojis inside the speech marks and now you can see I've got a tick or a cross instead of true or false the column still doesn't look very nice so I'm going to say as VIP so now we've got three very Nic looking columns I still have this example which I want to remove which I can do by saying from the data folder because example is not in the data folder or I could add a where Clause that says where the file name does not contain because exclamation mark contains example so I've now removed any file that has a name that contains example and there's loads of other different ways you could do it which just shows the flexibility of these queries now I'm going to clear this up a little bit so I'm going to remove all of that so you can see we've still got these files in there but now I want to do a calculation so I have the date of birth of all of these people so do o shows the date of birth but because of the literals that data view uses I can say date bracket now and then minus do OB so now I have the age in in milliseconds obviously I don't need milliseconds but I could then rename this as age so now I have my age in milliseconds or the age of these people in that time and borrowing from Doos a little bit you can see we have a much more fleshed out example which if I go to John and change his birthday to the 15th of uh October 96 you can see John will be 28 on the 15th of October 2024 and that's their date of birth it's working out the person's next birthday and how old they will be all from just the date of birth key and value inside of their file so let's have a look at how Doos did it we've got the table it's without ID so it's removed the first file and it's added that column back in and called it name we then have a column for date of birth which is the key value we already have so that's nice and easy but then we've got will be and when we look inside the file will be isn't anything inside of here it's not a key that he could use and neither is on so these columns have been created inside of this query now we've got a source so it's looking for the data folder so that's the data folder here so we've got 1 two and three so new person could also be here but there is an additional expression inside of a where Clause that says where there is a date of birth so if we go into the new person there is no date of birth so it's not being shown as a result and that there is no DOD so that's date of death which is something Doos uses in his example template Linked In the description below so we're filtering out files we don't need then we have a flatten and that creates rows for a unique property key value that they are creating and this has been named as this year age and the calculation is using the literal date for today the year so it's looking for the year of today is then using the date of birth which is a value we already have looking for the year of it and that's this year's age so if I come in here and put this year age as a column you can see it's created this year age in here but we don't really need that however this year age can be used inside of the next flatten so we've got date of birth plus the duration so all of this is a duration and that is named this birthday so we have this year age so that's 27 at the moment and turning that into a string so it's changing the number this year age into a string that also has plus a space and then years so when we type this bday it's showing October 27 2023 because it's added the date of birth which is is in 96 to the current Year's age which is 27 so 27 added to 96 is obviously 2023 and that's the date but we want to know how old that person is going to be so we've added flatten then choice so remember that is a value and then it wants a true or false for it so this birthday is bigger than today if the birthday is bigger than today then it's obviously in the future and if it's in the future we want it to show the current age so this year's age however if it's in the past well it means there's a birthday coming so there will be another year on top of today's age which means we want to do this year add one so they will be in this case John will be 28 on the next birthday and I will be 27 on my next birthday but then we want to know when the next birthday is so again we're doing choice this birthday and then is that bigger than today if it's bigger than then obviously it's coming up so this birthday if it's not then it's in the past then we need to add another year so this birthday add duration of one year and then that's going to be called on and the entire query is also sorted by that field so it's being sorted by on in other words the most recent birthday so the birthday coming up is at the top and the birthday furthest away is down the bottom so I was born on the 27th of October 966 I will be 27 on the 27th of October in 2023 John was born apparently on the 15th of October 96 and they will be 28 on the 15th of October in 2024 because we've already gone past the 15th as I'm recording on the 23rd so this birthday is still to come this year whereas this this birthday has already happened this year which is why it says 2024 here we have another example now this could be done with the tags plugin but this allows you to be a little bit more specific about your queries of the tags you're using so we have table and then we've got a length and the length is calculating a number so how many there are and you can see we've got rows what does rows mean it means we're separating out an already grouped field and we're then adding file. link so we want all of the files as rows that have been grouped in some way and that's going to be called amount what are we grouping by Group by T as tags what is t t is the flatten of file e tags so what this is doing is it's flattening out the files for all of the tags and calling it t then it's grouping by that and calling it tags so all of the files with example will then be shown as a number because it's being lengthed inside of the amount column this from is saying look from everywhere but if I remove this it doesn't actually change anything inside of the query and we're looking for where file. tags and coming into the documentation implicit Fields scroll down file. tags is a list of all explicit tags in the note unlike file tags does not break subtags down I.E tag 1 a blah blah blah blah so if we come into John we add a property we add the tags we add example and come back to our query it now says two because we've got John and Danny both with the example tag this query also being sorted by that expression that's being used so it's lengthening the rows of the file links so it's separating out this group by to look for all of the file lengthening that so two and then giving a description because if we add a second tag to John Stewart we now have two tags and the flatten is giving JN two results one for the example result one for the second result it's then being grouped so John one of John's is in here and one of John's is in here and they've been added together so Danny and John makes like this up and John just makes this up and it's being sorted by that using this expression so we have second down below an example at the top now I have deliberately left out data view JS because Js those people that understand JavaScript will probably be able to find the documentation and those that don't understand JavaScript probably won't need to use it um but just as an example of things you can do with JavaScript if you're interested you can see we have the JavaScript reference that works very similar to data view query language so you have data view JS but then you can search for anything inside of a code block reference so you can create tables create lists just like the normal data view query language but you can query slightly differently so the current file is DV doc current instead of this. file name you can search for all the pages DV do pages instead of just using the from and as you can see there are lots of other additional things you can do with JavaScript alongside writing your own code looking some something like this so what doas has done is created constants which is kind of like literals they are things that can be used later on in the code so time is equal to DV date of now which is similar to date brackets today from data view query language then created hour which is equal to time dot to format H so very reminiscent of the flatten lines where you say flatten then the expression then as and and then the name this is similar but JavaScript so we're creating a constant of hour and that's equal to this expression or this expression then we've got another constant of our word so this is our and our is the constant here so time. two format H and these numbers are literals being added these are comparators so is it bigger than or smaller than and the question mark and colons are if so similar to the choice if this is true do true or false but because we have two next to each other they are what's called nested if statements which gives us the text appropriate to the time of day which is all stored in our word so we have three constants hour being used inside of the hour word calculation then hour word and time being constants we can use to show and they're going to be shown in the header of one so it's a one header formatting we're going to show its add that to the time to format the time which is the constant and then it's going to be formatted like this with at T at the end so when we look over here at the render it's is the word here it's in a heading one format which is why it's bigger we then have the time in the format of CCC so there's the day there's the month there's the day again and there's the year then we've got at the word at and then T which is the time so it's currently 1601 it's actually not because I haven't refreshed the data view query but now it's refreshed to 1610 with the dot at the end with the next line saying DV header to so the format is header to which is why it's smaller writing good added to the our word which is this constant afternoon colon Danny so it's saying good afternoon because it's in the afternoon cuz that's what the time is a couple of other points worth considering is inline data view query language can be used so you can see here you can still use this file and then any sort of literal or function that you can normally use in dql the data view query language and that relates to this toggle which we turned on the enable inline JavaScript queries and also the enable inline queries making sure both of those are toggled on in case you use JavaScript or just the normal data view language and then looking at the code block settings you can see the inline query prefix is equals so instead of using an entire code block we're going to use inline code which is the same icon but only one of them and then to start data view instead of typing data view we're going to use equals and of course that's then thrown up the error data view inline filled error because I don't have anything in there so now I'm using an inline query looking at this file and then looking for this literal information which is just the file name so example which is why it's now showing example and it looks like text but when I put the cursor on it it actually shows the inline query and we can use any of the literals so let's just remove this and say date today because this is a literal and what we need to do is update the query so go into there now it's updated this is today's date you can see I'm recording this after the first session and because this is in line you can put words before it and then after it so now you have essentially a formula or a calculation potentially inside of text which can be very useful then you can also add CSS so if you go into the settings and we have a look at the parents tab the themes these files are written in CSS and what you can do is add it inside of the data view query and because it does require you to understand a different code language or markup or whatever you want to call it uh I'm not going to go into depth on this but you can see we've got these speech marks which essentially say hey this is the information we're going to change the font color and this is the hex code that we're going to change the font color to going to add a break then the plus inside of here we then have the key or property that we want to use so do o is the date of birth and then we want to rename this as do so it says that at the top otherwise it would have that at the top which isn't very nice so now I have orange result which is what this is and of course you can then customize that to add in functions and expressions with CSS so as a verbal example maybe you say if the date is bigger than 3 days or 5 days make it red if it's not make it green so you can add in different expressions with colors inside of the DAT of view queries essentially giving you full flexibility uh and let's just give you a couple of examples you can make that a three heading as well so markdown is still kind of involved here as well which is very extensible hopefully that helps you out a bit if you have any questions either go to the obsidian Discord and go to the data view Channel because there are loads of data view experts in there or you can join my server to get some help from me but obviously that's limited to me you can ask questions in the comments but YouTube and comment backwards and forwards is kind of difficult so be aware that