QlikSense & ChatGPT: How to connect QlikSense to ChatGPT and analyze data using GPT 3.5 turbo model.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this new section so all the hype is about llms large language models AI I'm sure that you hear about this every single day at work right and what we can do now is use click to talk to chatgpt ask it to analyze data ask it random questions and then retrieve the answer back and show it in your dashboard what I'm going to show is how to take the data that you have package it in a way that you could send it to chat triputi get the response and decode the response and then show it to the users as well alright so this is how it's going to look like that is when you send some information this is your prompt that you're sending and you get a reply with the answer from chatgpt and what you're going to do is um then you have some extra information like how many tokens and the completion tokens what was the cost and stuff like that so we're going to go in depth step by step let's get after it right all right let's first start from scratch let's go into the editor let's add a couple of sections here let's go to section number one and first things first what are we going to do we are going to input our data I have some data over here I'll have it linked below that is data input this is just our sales table basically okay so I have some sales here with order date uh product and amount and I have product name and the product ID here so I basically have two tables and I'm just going to load them so I'm going to say in subscription now I have two tables let's give this names I'm going to call this as my orders table I'm going to all call this as my products table good now we have two tables now let's make this into one table so I'm just gonna say my input table basically what am I doing well I'm loading everything from my orders table here so let me put it here and oops I forgot a load statement and this is well we're loading it from a table that's already there so what do we do what is it called resident table and it is from my resident table called orders next what I'm going to do is I'm just going to left join my product name because I have the product here I have product here and then I'm going to left join the name because I want the name in the same table because when we send the data to charge repeat we want all the data to be just in one straight table well you you could send two tables it doesn't really matter because then chart repeat would make the association between the two because it will realize that oh okay table number one has product and table number two has uh also product ID product ID here and it's got the name so it's going to make the association just like click mix okay but it's easier to just send it in one table so let's just do that left join input table and this time I want these two from Resident products table right good and since the names are exactly the same what's going to happen well click it might think that oh okay we have the same particular name zero so it's not going to load it again so in order to make sure that we The Click doesn't do that mistake well let's just make it a low concatenate load now we can basically drop the drop these two tables orders and products good so essentially now we should have one table called the input table with all our data in one single table right good let's load it and now we have one table with all our information that is even the product name has been added here because we did a join fantastic now what do we want to do this is our data and we want to send this to click click click wants to send this to chat GPT so if you look at the kind of information that chat GPD expects it wants your information in a Json format and that's how you need to send information to charge repeat so if you go into their API references and see how the data should be sent in well it tells you that what we want is Json format for the data that you are actually sending in good so we know what it wants but how do we how do we fix it because our table is not Json format right so let's look at how a Json format looks like so essentially you have uh flowery braces and then inside that you have the name the first name for the table which is broken down uh then you have flowery braces again then you have the name for different columns and then you have values so if you see here you see that this is a Json format so of course I'm sure you know what Json format is what we want to do is we want to take our straight table this particular table here and convert this into a Json format that is something that looks like this just gonna say input Json as my table name then I'm going to say load and then so what I'm going to say is first let's see here we want a name for the table that is here so I'm going to say this is orders then I'm going to say order date product ID product name and some other column that I have and then the values for each of them and because I'm trying to create it into a Json format I'm going to put it inside strings and I'm going to say this is orders this orders needs to be concatenated because I have a bunch of data that I'm going to add into this particular Json format right so concatenate what am I concatenating I'm going to give it a name that is first is of course uh curly braces via curly braces because we want uh curly braces here right um we have given this orders then we have curly braces we have name we have the value over here so we're going to go here and we're going to say order date this is the name of the table or the column sorry the value is nothing but all the values that are in this particular column so I'm going to say add concatenate this particular order date that is just bring in the values from here and put it inside the column called order date and the values for that is inside my pre-loaded column called order date and it's separated by a comma so inside the strings everything I put in a string is this the is a is a string value right and everything that's not inside the string is the values that I'm asking click to load from my table so here I'm going to give the next name um my next one is product close the string product values comes from my column called Product is amount over here column that is called amount the values are from the field call Mount the last name is so essentially what you're basically doing is giving it different attribute values I've given my different attribute values are order date product amount and now I have one more over here because that is product name has been joined right and the product name value comes from my field called Product name put that here close the flowery braces we are concatenating all the values so the values I want to be separated by a comma here and then our final as our input this is all of these values are coming from resident here good so what have we done now we just want to convert our straight table that we created we want to convert this into a Json format and you know how the Json format looks like over here and what we're doing is we're saying load orders and here we are concatenating we're giving each an attribute value that is the order date we could change it to whatever you want it does it so just giving it a name so this is what goes into chat GPT so order date what is the value for the order dates order of dates values is inside here and product is inside field called Product then amount is inside field call amount product name is inside product name and then you close this and then you put a comma and you do it again so for all the values that are inside this you're essentially loading it into a table called orders in the Json format like this that is like this right perfect super simple if you want to see how this looks like let's just do let's put all of this now this one Json input is in a table called input Json but let's put it and save it into a variable so that we can call it later so we say V GPT input data we're saying Peak into this particular field click into the field Json input and store it inside our variable called V GPT input data and you'll be wondering huh right so we made a single table and that particular table we changed it instead of having a column name and the values we changed it to a Json format and Json format is essentially this way so you have you open this you have a square braces then you have the name then you have the values and you store all of it so we're storing it in a field called Json input and then from Json input we're putting it into a variable called V input data so later on when we are sending data to chat GPT instead of calling a table we can just call call the variable because the variable now has all the information how does it have all the information because we are peaking into our Json input that is this field which has all the information we are peaking it and saving it into this particular variable that we have not so complicated right let's see what exactly happens so if we do a trace which what is Trace to trace prints out whatever is in a variable or whatever you write Trace hello this will be printed out when you run the script so that's what Trace does so now if you say stress is equal to dollar expansion this variable why because this variable contains the input that is Json input good so if we do that what exactly happens right so you see that what is variable input orders great then it says order date this is my value this is product amount blah blah blah and it's saved over here oh we're missing for product name we are missing a a colon here so we need to so we have product name right because that's the Json format right we need this column colon to tell uh chargerpd that this is an this is the attribute this is the value good so we missed that let's run it again right and now we have product name is camera good this is super simple everything is straightforward here right the only confusing part is this but I'll have it linked below so that you can just play around okay just replace this with whatever values you have in your table the values in the in your particular table the data that you want to send and if you don't want to send let's say you don't want to send the actual name of the product then just change the name to something else and you can always once the data comes back from charge repeat you could map it right you could do a mapping load and change it to your original name only in your click app so you don't need to send in sensitive data to charge repeat good this is step one done here we have our input input data good and over here we'll do PPT and what do we do usually when we send stuff to charge repeat we send it a prompt right so let us first write the prompt let we GPT prompt is equal to hi GPT can you analyze following data of course we're going to improve this later on okay oops let me write this following data we're going to improve this later on we just want to print out whatever it is so let's just say we're gonna just do a trace so that every time we change it we know what's going on right dollar dollar expansion of our variable why is that because we have saved our prompt whatever this prompt is into our variable called vgpt prompt we have this next what do we need to do we need to make a connection right how do we make a connection you need to First login to platform.openai.com and create an account it's really simple over there you can log in using Google and from the day you log in you have three months and 20 or 20 dollars or 18 or something that you can spend it's plenty of money trust me once you create an account well let's go to uh documentation let's go to API references and here they essentially tell you what you need to do so they're telling you the different models that they have right so if we go back here and let's go to models and you see that there are there are a bunch of models that you could use what is it that you want to use and how to use it they give you step-by-step install directions over here so if you go to documentation and models over here you know that charge apd4 it's a limited beta that's going on right now you have 3.5 you have daily do you have whisper and you have the different endpoints that is depending on the model that you're using what are the different endpoints so if you look deeper into this they actually tell you over here which Which models should I use and for what kind of tasks so whisper is for audio uh for edits it's text DaVinci for completions it's text DaVinci zero zero three this is their one of the advanced ones for completions and what is completion that is you send in a prompt and you get a reply back right and for chat uh it is gpd4 and GPD 3.5 turbo and they actually tell you here that the latest model that they actually have is the gpd4 more capable than any GPT 3.5 model but if you see here charge APD 5 3 0.5 models can understand and generate natural language or code are most capable and cost effective model in the GPT 3.5 families GPD 3.5 turbo which has been optimized for chat but works very well for task completion and here they also tell you in the latest model that is the turbo most capable GPT 3.5 and optimize for chart at 1 10 the cost of text DaVinci will be updated with our latest model iteration so this is one of the best models that you could use because it is optimized for completion even though it's a chat based it's optimized for completion and it is just one tenth the cost of what you would be using for text DaVinci and don't worry it's not gonna cost you much I'm gonna tell you that right now uh and they also tell you we recommend using GPD 3.5 over other because of its lower cost you know what Sam Altman I'm gonna listen to you if you say this is the cheapest and the best I'm going to use it okay let's uh let's just do that so let's go back to overview model compatibility and here when we see the end point is V1 chat completions and this is chat GPT 3.5 turbo okay this is what I want right good let's go back to our API references and let's go to the models I'm looking for chat completion Tubidy 3.5 turbo good this is exactly what we want right we want our model which is 3.5 turbo and I want how how do I actually get to it everything is given here in platform.openai and it is so cool I mean the time to be alive where you could just look at an API and really build it out by yourself super simple trust me it's not hard by the end of this you're going to be Pros okay so let's go for it what are we gonna do I am going to go to create a new connection okay I'm going to create a new connection and over here we're going to rest API I'm going to go here and click on here rest I'm going to click on this what is the URL let's go back to my API reference the https should be API dot openai.com V1 chat completion so I'm going to copy this I'm going to paste it over here that is My URL the method is post why it's because I'm posting something to charge repeat and then pulling up pulling back the information right so the first operation that we have is a post so we're gonna say post what is the request body request body is the information that we're sending in that is it has to be in Json format if you look over here it has to be in Json format and the parameters should be like this that is you're telling it what is the model name inside double quotes and then message you have role user content and the content is hello okay I'm going to copy this right now and I'm just going to paste it here so the request body is just going to be model triple 3.5 and message is going to be role user content as hello all right then let's go down and now I need to authenticate it by it's by some way right how do I authenticate so it's gonna I'm gonna go back here and content type is application all right so I'm going to copy this and this is under headers so I'm going to go back here and we have something called query headers so over here content type and I'm going to copy content type application Json good let's put that here next is authorization good authorization I need to add another one so authorization and authorization over here is my API key okay so now this is why you needed to create an account with your platform.ap openai.com why because you need to authenticate in some way when click talks to charge repeat it should know that huh okay this click request that's coming in is actually coming in from this particular person who has an account with me and there and how do I know that they have an account with me I want to show the key and how do you find this particular Key Well you go to your accounts and over here you click on view API keys so when you go to overview API Keys you see your different Keys over here and you also see the keys that you generated before so now I'm going to go into my create a new so I'm gonna say think metrics test click test so I'm just going to give it a name and then I'm going to say create a key now I have this particular key hey please don't copy it okay please I don't want to get a Big Bill from you guys I'm gonna copy this done I'm gonna go back here um wait a second I have to say Bearer space open API and then paste the open API key because it says dollar so this I'm going to replace this particular thing by my API key and here is Bearer okay so first I need to type Bearer DEA rer space and then my key good this is done now I'm gonna give my name and is there anything else no so here I'm gonna give it as think Matrix GPT test I'm just going to give this a name now let's test the connection let's see if it works and it says connection succeeded right awesome booya now when you go back to your API that is over here think Matrix click test you see that never used but now you just made a connection that means that what has happened is that you have sent in something to this particular link you have used your Authentication key and you have sent in a request body what was the request body that you sent you send hey use the model 3.5 turbo the message is from a user and the message is hello right that is what you have sent to charger PT and you just did a test connection now when I go back here and I do a refresh you see that oh right so now it has been used so you know that this has been used right good and the connection works fantastic and now we're gonna say with connection that you will know this later when we're going to write our code so allow with connection and I'm gonna say create and now this think Matrix chargerpd 3.5 has been created we saw something over here that is request body right when we go to our API we have something called request body and now we're gonna write the request body here what is the request body essentially request bodies whatever your information you're sending to charge apt and it has to be in a certain format you know run by now that the data has to be in Json format everything else as well the parameters see if you see here has to be in Json format essentially just like this so we're just gonna copy it we're gonna go back here and here we're going to say let's put this into a variable as well so that it becomes easy for us to replace it right so let's say V response body now how do you how is it supposed to be well it's supposed to be like this so I'm just going to paste it here so it's supposed to be in Json but this is click and we're sending it in so I'm going to put this whole thing into inside a string that is single quotes so now you know that since this is a variable V response body so I have to say let V response body is equal to right and close this one right so we let response body is equal to open curly braces and it ends with the close curly braces as our reference says over here good that's fantastic that's exactly what we want now except here role is user and content is hello but our content is not actually hello because our content is actually this prompt so what the user sends to charge repeat is we want to send the prompt that we want right so I'm just going to replace this Hello by my prompt and what is the prompt prompt is nothing but my dollar expansion of whatever is in my variable that is V chat GPT prompt that we wrote over here right so whatever I change over here has will be will be replaced here now it's not just the prompt that I want to send I also want to send my input data right so I'm gonna it's super easy because my input data is already stored in my variable here so I'm going to take the variable and over here I'm also going to say once this is done then the source is dollar expansion of my input data that is V GPT input data that is my V GPT input data that I have massaged from a table to a Json and then placed in a variable let's just call it here and put it inside our little response body that we are sending to chatgpt so what are we doing here we're telling charger PD hey model is GPD 3.5 turbo the messages role user content is the prompt that is the prompt that is over here and along with that send the input data as well that's about it now you could enter many more things for example you can enter different attributes like temperature top B and stream stop Max tokens and things like that right so I could even tell them hey uh I'm gonna add two more things for example Max over here just so that I don't make a mistake and send in a ton of data I could tell them hey here Max token 1000 and temperature is 0.4 what is temperature well the temperature can be there's a sampling of temperature to use between 0 and 2 higher values like 0.8 will make the output more random while lower values like 0.2 will make it more focused and deterministic we generally recommend altering this or top B but not both you know what we will leave it to 0.4 doesn't really matter and it ends with this one great what you could also do is add system roll over here so you could say messages role is system content is you have to always act as an analyst who is working for a top 500 company blah blah blah whatever right you know all about prompt engineering by now so you could add that let's keep it simple just so people don't get super confused now let's close this but we have one issue if you remember in one of our sections I showed you where during the variable Inception click once you put things inside single quotes click doesn't recognize other characters for example inside single quotes I have now put this double quotes right so click doesn't really recognize this as a double quote so it's not sending in the right format because that's a string version that's being sent to charger PT but over here if you see charger PD wants a double quote not really a string version of the double quote so what we're going to do here is exactly like what we did in the pre in that section in the variable Inception section instead of all the values over here that is that comes in inside a string instead of putting in the symbol what we do is we put the character representation of it so in this case character 34 gives me the double quotes So what I'm going to do is I'm just gonna say exactly the same that is let V response body is equal to that is exactly this particular variable so we're just updating the variable right so replace this variable every time you find a double quote here replace it with character 34 good so what have we done here essentially what we have done is we have totally clicked hey this variable since this is a string and you're not really recognizing this every time there is a there is a double quote replace one single double quote with double double quotes and not really double double quotes but the character version of it so now you're sending in the actual double quotes to click sense in the Json format or to chat CPT in the Json format so that it's able to represent it correctly and just to see what we're doing whether this is right we could how do we how do we find out whether what we're sending is right exactly that is we could use a trace so over here Trace but this is V response body I want to print out the V response body so let's see what's happening now I'm going to click on enter and I'm going to load it so this is our first one good uh this is the first one here and now when you see here we see GPT prompt and in the response body we see the model right we see the role and the content is high GPT whatever can you analyze the following data and where does this come from this comes from my GV GPT prompt variable right good after that we have the data that's following it so now GPT is getting a set of instructions if we are telling it which model to use and inside messages we are also giving it a prompt and we need to improve our prompt we'll do that later we're giving it a prompt that is high GPT can you analyze the following data and then we are also sending in the data along with some other ones like Max token use only 1000 temperature 0.4 this looks like the format that we want so that's pretty good pretty good we're almost there one final thing now we have this now we need to actually send it right how do we send it let's go back here and let's go to edit and over here we say allow with connection done then when we click on this one here that is to look at the response so we did send something right what did we send uh hello or something this is a test or some something that we sent here we sent content is hello we should get back from assistant we should get hello there how may I assist you today that is the answer that chat GPT should give give back to us and how do we how did we get this we sent in a test connection right so in text test connection we said model role and message our our content as hello and charge upd when it succeeded that means that it got the information it verified that it is from this particular API key it sees that oh we have an account with openai you have either paid or you have free tokens so you're allowed to use openai API and therefore I'm going to reply back to the message hello with hello there how may I assist you today this particular answer will also be in a Json format so you see this and that is something we need to clean and over here inside this Json format what we have is we have some more information it just doesn't give you when you say hello it just doesn't say hello there how am I assist you no it's a bit more it gives you an ID that is for that particular transaction or the request it gives you an ID it gives you a date it gives you choices index 0 what was the role this is what I told you like system user user is what you're giving in assistant is the answer that comes from there finished reason the number of tokens that was used and the total tokens completion tokens how many what was the prompt tokens so this is under usage and the rest is under over here so we have under messages so we have a bunch of information that we need to need to clean up right so let's go back here and here we have something called root and inside root if we see oh we have choices inside choices we have message so hello there how can I assist you today exactly right hello there how can I assist you today that means that we have got back the right kind of reply and the reply is under content that is the name of that particular table as you see over here you have choices you have message and inside message you have a column called content and inside content you have how many issue today exactly what the reference API said inside content so you see if you try to read the API and try to do things it becomes super simple and super straightforward good now all we need to do is just extract this particular information right so I'm just going to say insert script and voila what click has done is it says Hey Library connect to think metrics.gpt 3.5 turbo test that is the particular API rest API that we created with our API key with the URL with the we are authentication and everything and what this is what charge GPD sends back and the information is somewhere inside here so if you see here it's inside inside message inside content that is where you will find your response from charge repeat inside usage table inside prompt tokens you will find your number of tokens used that's how you can see that okay it's inside content now click has already separated all the tables so we already have the prompt tokens completion tokens total tokens over here we have the role content and message so we know already that our answer that is the gpt's answer is going to be over here and then you have some finished reasons and all of these things let's say we have prompt tokens here we have completion tokens here we have total tokens here now we could calculate total tokens into the cost for that that is the number of tokens that should give us how much what is the cost for the request that we have sent right how do we do that let's go into openai dot pricing and here what is the model that we're using we're using GPT 3.5 now you remember we spoke about DaVinci DaVinci is 0.02 per thousand tokens and GPT 3.5 turbo which is a much better model is 0.002 for 1K so that is I mean it's one tenth the price right that is amazing so let's take this usage and make this divide per thousand right the Thousand tokens 0.002 dollars so we could just multiply the total tokens that we used into as cost per request now we need to now we have content and this is as our response we want to save this because this is where my answer is Right GPT response is inside content just as they tell us over here GPT response will be inside content good so this is the GPT response I'm just going to rename it finish reason index yeah you know let's just make things simple let's just remove all of this we don't need it for now now we have these two I'm just gonna rename this particular table to responses to the same table good so now we should have one table with the response where we have our cost request CPT response good but what are we sending to charge upd to get the response what we want to send is this we response body but we haven't really told anything right so we are connecting with our connector here but we're not really sending anything because where is our prompt and the data it's stored in we response body but our V response body the variable is not being added anywhere here that is where our allow with connection comes in if you see here we have said with connection right so over here we're going to say with the connection we are sending body we are doing a dollar expansion of our variable called V response body and this V response body contains what does it contain well it contains all the information that Chad GPD is asking us to send what is it asking us to send it's asking us to send this particular information that is model any kind of extra temperature or top b or stream or Max tokens or blah blah blah all of those things along with message what does the message contain the role user content and the actual prompt over here inside content and all of that we have saved inside over here so we have a Content we have our prompt we have our input now I think it's time to test let's say load oh what happened something went wrong now I need to look at okay there's a comma here oh I forgot to call my hair all right so a comma because if you see here each of them have to be separated by a comma right and I didn't put a comma over here so let's try again and it says connected and yes all right all right so it says line switched for Jupiter response 1 lens fetched one good good good so now if I go back here I have my input I have a GPT table that has been uh that is the response and inside that I have number of tokens completion tokens the role cost and the GPD responses inside this particular so GPD response is inside this particular field right let me also just save this V GPT prompt in the same in the same table so I have this table and since the prompt is just a variable oops I could just paste it that is I could take whatever my prompt is that is here this so I can take V GPT prompt and just save it over here we have our GPT response and has prompt done and just gonna save this load it and it's successful again great great and now if I go back to my API I see I reload it and you could go into your usage here and it tells you how much you have used so I've used like 0.37 dollars today yeah that's okay right good so now let's go to the front end we have a table with the input data we have the response here from that is the analysis that charger PD has done with our input data it's taken in our prompt and it's done some yeah some things right so what we can do is we could well make a dashboard I'm going to go to this one and over here what we could do is first is I want it to be our prompt so I'm going to say what was it R prompt but since this is a measure I need to put I need to wrap this into by using only and now I have GPT analyze the following data that was my prompt correct and now let me go back to appearance give this a name and here I'm going to say are pumped next over here I'm going to say GPT response and our GPT response is stored inside a column called GPT response am I correct so if you go back here we have stored our GPT response that is the content into GPD response column here perfect so let's go back here then let's actually give it give some information on the tokens that we used and stuff so copy paste just so we know right so over here I would say total tokens I think it's called addition token yeah completion tokens get here we could say cost that is our cost per request okay now we know and we could also say your cost was dollar and this one so now you know how much it was dollar 0.008 I mean come on super negligible right response cost let's make this smaller because what we are mostly interested in is this over here right kid now I want a bar chart I'm going to put this here let's make a table over here and over here I say ordered it and measure as amount sum of amount and also product name group them by product names and over here Dimension as well is I want order date product name amount of some amount good now we have this now I just I want the date to actually be um per month right so here I'm going to say order date month start first let's aggregate it to month start and then convert the date to your your your dash month month right so let's do that so month start your your month okay now we have it per month and let's do the same thing over here so we know let's add a dimension per month so done and this one here let's go into appearance and let us go to presentation make it horizontal and also give it different values and go back here and amount let's say I want this to be a number good this is the data that we have sent this is the actual data right why is it the actual data well because we have our input table automatically here so this is the real data that we are sending in and this is the response that charging PDS sent us so let's see the data consists of a list of orders each with an order date product that's really that's correct generally January to April one two three four that's right there are two products being sold cameras and software camera and software really good the total amount of order the amount ranges from 120 to 850 interesting it's missed it's actually thousand one fifty uh there are nine orders the orders are not evenly distributed that's good uh a bunch of things right so it's actually telling us the highest amount ordered was for software okay but it says that the order was 8.50 that's not really true because the order was thousand one fifty okay so you know that it actually gets it wrong sometimes interesting overall the data searches of the company is selling these products is doing reasonably well with the consistent sales across the four months however there may be some room for improvement in terms of promoting the camera product as it has fewer orders compared to software so it's you know it's making analysis and it's actually telling you that hey uh it looks like the cameras are not being sold as much as the software so you could make an improvement and yeah sell more cameras instead of the software I mean this is this is fantastic right now what we can do is we're going to improve this that is we're going to give it a much better prompt and also if you see here the system message role author of this message can be system user assistant right what system basically does is well let's let's see if they have information on it so I'm gonna go into chat GPT and I'm gonna ask it tell me how and why settings all right understand the purpose of the system the system component and charge APD is responsible for providing consistent context aware responses it acts as a character in the conversation and helps maintain conversational flow and coherence by adjusting the system setting you can fine tune the behavior of this conversational character so this is why setting a system is important now over here I've just said hey analyze this data right instead now we're gonna first tell chargeupt hey you are an analyst this is your role you have been doing you know we're setting a character to charge ability and then we are saying next The Prompt is can you analyze this data or whatever the user really wants okay so let's go back here and let's just copy this and let's see let me add here and then there's a comma rule is system and the content for that is well I need a new variable so I'm going to say chat GPT system prompt I haven't really created this variable I'm just going to copy this and that's about it and here we have our prompt then let's create a system prompt that is let V GPT system prompt is equal to and here I can give it a prompt so let's say you are a financial but in a shakes experience I don't know how hard is first Shakespeare has such a Shakespearean I guess it's a word I don't know uh test it out in a Shakespearean way using Pros okay this should be I've never tried this this should be really fun all right and also the prompt over here uh so first the messages role is system here the system is your financial analyst and a stock Trader doing deep analysis on company performance and portfolios give your in-depth analysis on the company performance but in a Shakespearean way using Pros that is the first input so now charge repeat is primed right it knows what it's supposed to do and how it's supposed to answer next is the charge repeating input that is the prompt can you analyze the following data but I also want to say it summarize the data per month give the total sales for different products per month next what else do you want which is my best performing product and analyzing the following data good now we have this and we have our GPT prompt system prompt we have our regular prompt and then we're going to send in the data again let's do this something went wrong all right so you you can't have this in two lines if you want this in different lines then you need to do a peak and put everything concatenate all of it into one line so now I'm just gonna put these two into one line right if you want to write it in an easier way what you basically can do is just do an inline load and then do a concatenate to one line that's about it okay I'm gonna go give a load again close and now let's go let's go to the front end right so so let's see let's see what it has done it says hark let me Regale the with the tale of sales of products sold and profits gained each month in January camera and software were brought for 120 and 300 gold coins a lot amazing Below in February so if it was a star with 200 coins spent a song Quite bizarre yet camera did not falter for 200 it made on the 14th of February a sale it did trade March saw software rise again with 250 sold whilst camera made 300 a sound quite bold April came and went with camera selling 150 and software 500 a some quite Nifty so let us tally the sales and see which products Reigns cameras sold for 770 gold coins of feet that sustains while software sold for 2 150 a sum that is quite Grand and makes it the best performing product undoubtedly oh my God I I don't know what to say this is this is by far one of the coolest things to a new love with this oh my God I love technology this is so cool um I didn't expect this I really didn't so if you oh hark let me Regale thee with the tale of sales of products sold and profits gained I mean I'm speechless I don't know guys come on okay I don't even know what to say let's go back let's say okay chill with your Shakespearean Pros and just give me your performance just just give me a performance okay okay and now we have we have a straightforward answer at least and in the straightforward answer it is based on the data provided the total sales for each product per name uh per month are as follows uh January is 120 this is correct right so we have 120 here for camera thousand one one five zero two hundred two hundred uh 300 to 50 that's correct 150 and 500 that's correct that's good the total sales for camera a is 770 so if you put it on camera 770 that's exactly right total sales for product B software is 2100 so if I put software IC 2100 and based on this analysis product B is the best performing product with the total sales of 2100. perfect I mean that's right I don't I don't know what to say so if you want to make any changes make the changes here I hope you really really liked it I'll have the link for this below uh so that you can download the script make the changes create an API play with it get your own Shakespearean Pros I hope you have fun I really had fun building this I really really did I I'm still speechless like I did not expect the pros to be so freaking good I'll see you in the next ones yeah have fun peace out [Music] [Music]
Info
Channel: Thinkmetrics
Views: 3,495
Rating: undefined out of 5
Keywords: qlik, qlik sense, data, data viz, data vizualization, dashboard, data dashboard, business analytics, analytics, data analytics, data science, tutorial, how to qlik, how to tutorial, qliksense tutorial, learn data for free, learn qliksense free, qlik sense free tutorial, full tutorial, build first app, qliksense full tutorial, data model, qlik view, set expressions, ai, openai, chatgpt, chatgpt model, ai data analysis, chatgpt4, chatgpt 3.5 turbo, chatgpt and qlik, qlik and ai
Id: hD5MmoWZlWM
Channel Id: undefined
Length: 54min 43sec (3283 seconds)
Published: Wed Jun 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.