I am creating a basic table view for some data. The data is obtained using a form that is laid out like this:
Year: @@@
January surveys: @@@
January score: @@@
February surveys: @@@
February score: @@@
…
(in which “@@@” means that there is an appropriate text field like jan_surveys etc)
I’d like to be able to create a Table that looks like this:
Year Month surveys score
2002
January xxx xxx
February xxx xxx
March xxx xxx
...
2003
January xxx xxx
...
…
anyway, i have had some trouble coming up with a way to have certain columns have constant values (in this case, the months of each year).
Does anyone have any ideas or should i explain this a little more?
Thanks!
– David Cairns
Subject: constants in view
Not sure what you mean by “constants” - it sounds like you just need to categorize the view by month.
Subject: RE: constants in view
You’ve made things more difficult for yourself by having a document for each year rather than one for each month.
You’re going to have to have a way to know how many months there are in the document. You should come up with this number as a computed field on the form. You also will need a multivalue of the monthly values that are filled in. This also should be computed on the form, for efficiency.
So let’s say you have two multivalue number fields, Surveys and Scores. If the form has been filled in thru July then they each have 7 values. The formula for the Surveys field might be something like:
@IfError(
@ToNumber(
@Trim(
@Text(Surveys_1) : @Text(Surveys_2) : @Text(Surveys_3) : @Text(Surveys_4) : @Text(Surveys_5) : @Text(Surveys_6) : @Text(Surveys_7) : @Text(Surveys_8) : @Text(Surveys_9) : @Text(Surveys_10) : @Text(Surveys_11) : @Text(Surveys_12)
)
);
“”
)
You will need four view columns. The first will be hidden, sorted, with the option “display multiple values in separate rows” and will have the following formula:
@Subset(1:2:3:4:5:6:7:8:9:10:11:12; @Elements(Surveys))
The second field must not be sorted, and will show multiple values in separate rows. Here’s its formula.
@Subset(“January”:“Feb…mber”:“December”; @Elements(Surveys))
The next two columns will show Surveys and Scores, not sorted, show multiple values in separate rows.
I’m assuming here that the form will only contain values for consecutive months starting in January. If that is not so, you will need fancier formulas.