How to Coda dummy data?
Fill out dates & turnover in seconds
I came across a question in the Coda community about top 10 sales. The user did not add a doc nor screenshots. When I help I often generate a table that might look like the table the user has in mind. This table it is about dates and money.
We use a button
To generate a list of weeks we apply something rather simple, see below:
I start with the creation of a full year using a
Sequence() on the start of the year and the end of the year. Both numbers are always the same. Jan 01 and Dec 31. The only variable is is the year and since it is nice to have a relevant year, I went with
Today().Year(). We apply
ToDate() to turn the text string into a date.
Next I only needed the weeks and this I got via filtering on a Sunday (my week starts at a Monday, so Sunday is day number 7). This list of numbers I put into a table via
AddRow() and as you can see the CurrentValue is the filtered date. Via 3 columns I ask for a specific property to that date:
- the week number
- the date (the CurrentValue)
- the weekday name
To get for each row a different number I assumed I could use the rather new function
RandomSample() in the button, it did not work. I got the same number for every row. Nevertheless on the canvas it works fine (the 1 is replaced by the count of the table):
Instead I use
RandomSample() in the option ‘value for new rows’ and I ask for one value (one per row). This works fine and fast. I started with a text column and formatted into currency.
The result is a blend of two functions: one via the button and one via value for new rows. The result is a table that can be used to demonstrate formulas and functions.
I hope you enjoyed this article. If you have questions feel free to reach out. Though this article is for free, my work (including advice) won’t be, but there is always room for a chat to see what can be done. Besides you find my (for free) contributions to the Coda Community and on Twitter