Jimakos Posted February 5, 2011 Posted February 5, 2011 Hi. I have a simple text field containing these values: "1¶ 2¶ 3¶ 4¶ 5¶ etc..". It is created by a value list (check boxes) containing these numbers. I want to create a calculation, probably a repeating one, containing field with a date plus each of these numbers. For example: 3 fields day...date...result (repeated field, date, d-m-y) 0....1-1-11..1-1-11 2....1-1-11..3-1-11 5....1-1-11..6-1-11 I tried to make it with the "extend" function, but it only calculated the last value. Anyway I don't like using repeating fields, but I can't think of an other way. It is a database that holds names and other data and use a portal to show the dates of an action each week. This portal is what I'm trying here. Thanks for your help
Jimakos Posted February 5, 2011 Author Posted February 5, 2011 Just a simple date field that manually states the beginning of the week.
comment Posted February 5, 2011 Posted February 5, 2011 Try = Let ( [ i = Get ( CalculationRepetitionNumber ) ; n = Extend ( NumberOfDays ) ] ; Case ( i ≤ n ; Extend ( StartDate ) + i - 1 ) ) Another option is to calculate the end date and make the relationship: StartDate ≤ ActionDate AND cEndDate ≥ ActionDate
Jimakos Posted February 5, 2011 Author Posted February 5, 2011 Thanks Comment. I don't need to get the dates like that. Let me explain it more.. The week starts on Saturday. There's a date field that I manually enter the date. Lets say "5/2/2011". I need to register the day that the action happened. For example Sunday, Tuesday and Friday. What I have is a value list containing these values: 0, 1, 2, 3, 4, 5, 6. These are the days after the starting date. Then there is a field "day" with checkboxes, with the header "Saturday, Sunday, Monday" and so on. So you check the boxes of the corresponding days. Here: "136". Then there's a repeating calculation field that have to do this: rep1= 1 + date field, rep2= 3 + date field, rep3= 6 + date field. So the results would be like this: rep1= "6/2/2011", rep2="8/2/2011", rep3="11/2/2011". Then I can have a report, that states who did the action everyday of the week. I'm trying to get that result all day, today.. Thanks for your help
comment Posted February 5, 2011 Posted February 5, 2011 Does the order matter - or do you use this for a relationship only?
Jimakos Posted February 5, 2011 Author Posted February 5, 2011 No the order doesn't matter. As I see it, it's a case of creating a repeating field with each character of a simple field: simple field = "5314" repeating field= rep1 "5", rep2 "3", rep3 "1", rep4 "4" I just tried to do it using " Left ( day ; Get ( CalculationRepetitionNumber ) )" but with no luck.
comment Posted February 5, 2011 Posted February 5, 2011 OK, so how about = Let ( [ i = Get ( CalculationRepetitionNumber ) ; d = Extend ( MarkedDays ) ] ; Case ( i ≤ ValueCount ( d ) ; Extend ( StartDate ) + GetValue ( d ; i ) ) )
Jimakos Posted February 5, 2011 Author Posted February 5, 2011 Yes, yes... Thank you very much. It's exactly want I wanted... Now I need to study it and find out what was I supposed to do. Thank you
Recommended Posts
This topic is 5098 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now