Why not use a checkbox, or depending on your setup, use a related table to store the tags... Creating multiple fields like this goes against the rules of normalization.
I would like to use a related table to store the tags, maybe my set up is not done correctly. I do not think a checkbox would work because the list of tags could be quite long and is not really pre-defined.
Well create your second tag table. It should have the foreign key of the documentID. You can use a portal to enter in the keywords if you would like ( turn on allow creation of records ) or you can script the process.
A portal makes a lot of sense, not sure why I didn't think of that. What about being able to count the tags? Is that possible in this setup?
Sure. A simple subsummary report will give you totals. Create a subsummary report based on the tags table. Keep in mind that a subsummar report will only work properly when it is sorted by the break field and also only reflects the found set.
OK, almost there. I've successfully set up a portal so that users can add tags to a document in a "one-tag-per-record" format, and I have created a sub-summary report in the Document Tags layout/table that counts when I sort by tags. However, is there a way to get those numbers in another way, so that I could reference them in calculations?
Ideally, I would love to be able to create a visual representation of tag popularity like you see on many social media sites where the font size or some other characteristic is based off of the tag popularity.
Sure, in the document reference table, create a calculation field that contains:
Count ( Tag Table:ID Field )
Okay, so I created a calculation field in the Documents table that is COUNT ( Document Tags::Tag ) and it returns the count of the number of tags per document. How can I get the count of tags by tag? For example, if I have 5 documents with the following tags:
Doc1: red, blue, yellow, green, orange
Doc2: green, red
Doc4: blue, red, yellow
I'd like to be able to see that the tag "red" has been used 4 times, and the tag "orange" has been used 2 times.
To compound the problem, the list of available tags is not pre-defined. It is whatever people enter, which gets added as a record to the Document Tags::Tag field.
Create another table where 1 record = 1 tag name. Relate it to your document tags. Put your count function in this table.
cn_number_blue = Valuecount ( Filtervalues ( List ( Tag Table:Tag name ), "Blue" ) )
cn_number_red = Valuecount ( Filtervalues ( List ( Tag Table:Tag name ), "Red" ) )
cn_number = "Blue: " & Valuecount ( Filtervalues ( List ( Tag Table:Tag name ), "Blue" ) ) & ", Red: " & Valuecount ( Filtervalues ( List ( Tag Table:Tag name ), "Red" ) )
Anything more complex, like numbering and filtering based on an unknown set of tags, will probably require a custom function, or a calculated repeating field based on a value list based on the Tag Table:Tag Name field.