Looker Connect Training
Help Center
Documentation
Community
Cloud Certifications
Some day someone asked how do I go from here:Missing cases in an integer numbers variable in X-axis are not plotted. Only existing x cases have correspondent y values, but all are placed one after another.To something like this:The independent variable is regular spaced and missing values are plotted as having y=0.I know, the very fast answer: go talk to your BD admin and ask him to build such x-axis independent variable.But what if I feel brave enough to try it directly working on Looker?Well, here are the steps I took to achieve it:1.- First, grabbing any enough long in rows DB field, like ID for example, through ROW_NUMBER() function, I could set up a derived table that contains a regular paced variable with a proper alias.derived_table: { sql: select row_number() over(order by Id) as consecutivos from public.products;; } 2.- If the field with jumps is a Dimension, convert it to a Measure. Using this awesome trick 3.- Merge accordingly, taking as primary query the
Already have an account? Login
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.