Looker best practices
Mar 2, 2022
How to count the number of views in a model:
- Open the project
- Click Ctrl+Shift+i (to open the Java console)
- Paste the following code and you will be able to see the number of views
Note: Make sure you open all the subfolders so that views are visible in the UI. Only then this shall work
hrefs = document.getElementsByTagName('a');
i = 0;
for(var j=0; j<hrefs.length; j++) {
if (hrefs[j]["href"].includes("view.lkml")){
i++;
}
}
console.log(i);