19 August 2020 | 9 minutes of reading time
DATERANGE(start, end, [format])And since in this case we want to see the data per month, we have to combine the data range function with a GROUP. Suppose you use a dynamic source and you also want to display new data, you can also replace the parameter end with a function like TODAY().
GROUP(DATERANGE("2020-01","2020-12","yyyy-MM")) GROUP(DATERANGE("2020-01",DATEVALUE(TODAY(),"yyyy-MM"),"yyyy-MM"))By using one of the two functions above, you can be sure that the X-axis will display all possible dates, and it will not only read what it receives. It is important to combine this function with the LOOKUP function in your series. Earlier Tamara has written an extensive explanation about this. By using the lookup function for the series, Klipfolio will always link the correct values to the correct dates. If you don't, in this scenario you will get a graph with shifted dates, where April is reported as March, and so on. By using the LOOKUP function Klipfolio records that there is no matching value for the months March and August and will then report it as 0. In this way you do not sketch a distorted picture and you can quickly find errors in the data.
LOOKUP(X-as, Kolom A(datum), Kolom B(data))Alternatively you can enable the setting 'Leave gaps for blank values'. The graph is then plotted as follows, with 'holes' where the data is missing for March and August
SELECT(B:B, A:A="foo")This will give the results: 100 300 Suppose we want everything but ‘foo’, so
SELECT(B:B, A:A!="foo")Now we get the following results: 200 400 We don't want that header here, so we'll remove it first
SELECT(SLICE(B:B), SLICE(A:A)!="foo")Now, the result is: 200 400 But what if we forget this in one of the cases?
SELECT(SLICE(B:B),A:A!="foo")Now we receive: 100 300 When you use the SLICE, it is important to always keep a close eye on the formulas. Is the slice included with all components in the formula? Do all evaluations (lightning bolt on the right side of the formula bar) show exactly the same amount of data? If so, then you have done well. Tip: have you used a SLICE but don't get the results you expect? Make sure you have used it everywhere before looking for the problem somewhere else.
Get in touch with our experts for a free consultation and see how we can help you unlock the full potential of your data.
&samplingLevel=HIGHER_PRECISIONThis sometimes helps, but not always. A second option is to use dynamic parameters in the API call. Variables you create in the clip can be used again in the query to the API. This is done with {props.[variable]} where [variable] is the name of the variable you created. An example of what this looks like is:
https://www.googleapis.com/analytics/v3/data/ga?ids=start-date={props.firstmonth}&end-date={props.lastmonth}&metrics=ga%3Asessions&dimensions=ga%3AyearMonth%2Cga%3AlandingPage&samplingLevel=HIGHER_PRECISIONWhat we always recommend is to use the Google Analytics Query Explorer. In this tool, created by Google itself, you can login with your GA account and click on all possible metrics and dimensions. Click on run and the page will show you the complete query at the bottom of the page, as well as the results and above an indicator that shows whether sampling has taken place. This was our list of common and avoidable errors in Klipfolio. Undoubtedly you can mention more mistakes or tricky examples from your practice, do you have any questions or do you want to know more about faultless or easier clip building in Klipfolio. Please let us know: contact us Do you have a specific problem for which you are looking for a good solution, then please don't hestitate to contact us.
We provide custom solutions tailored to your organization at a great price. No huge projects with months of lead time, we deliver in weeks.