6.5. Tips for Editing Formulas in Looker Studio
When editing formulas in Google Data Studio, it's essential to know how to work with the available space effectively, format your formulas cleanly, and add comments for your future self or colleagues.
Here are some tips for doing this:
- Space: When editing a function at the chart level, the space is limited. However, when editing at the data source level, you'll have more space to work with.
- Entering new lines: When writing formulas, you may need to hit the "Enter" key multiple times (at least twice) to create a new line.
- Formatting with tabs: Use the "Tab" key to indent your formulas for better readability. If it doesn't work at first, try hitting "Tab" twice.
- Automatic formatting: There is no automatic formatting in Data Studio, but you can try to format your formulas by clicking "Format Formula." Note that the results may not always be perfect, and you might need to adjust the formatting manually.
- Adding comments: Although not documented in Data Studio, you can use double hashtags (
##
) to add comments to your formulas. This is a good practice, especially when collaborating with others or when you need to explain the logic behind your formula.
Remember, these tips can help you create clean, easy-to-understand formulas, making it easier for you and your colleagues to work with them in the future.
Enroll in the updated & extended Looker Studio Masterclass 2024 →
📩 Receive my weekly Looker Studio tips
🎥 Subscribe to my YouTube channel
🖇 Connect with me on LinkedIn