I wanted to share a tip that has become very useful lately for me.
Imagine you have an input control and your data may vary if you choose "daily", "weekly" or "monthly". You could also have a large formula that selects a range of dates. Anything that makes your code difficult to read.
In one of my Klips, I have 3 user inputs: Date from, date to and period (weekly, daily or monthly).
So my "date from" and "date to" would interact to form a date range that I would use with select function to get data only from that period or groupby, like this:
you can end having something like this:
You can have all the code that is repeated again and again just in an extra data and reference it, using it kind of a s a function.
All my series have the same structure, so I use the same data for all of them (dates are the same for all). I then can in other Klips just copy and paste my codes in these data and create the same for similar klips and so. This way cleaning the code. Another person that sees your code now will be able to understand it if you name your data correctly. There is no need to see what is actually inside this black boxes.
I hope this helps, cheers!