Jump to content
Server Maintenance This Week. ×

Calc number to container


This topic is 6993 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a strange calc problem which I would need some help with.

Basic

I have a 52 rep number field and a 52 rep calc field set to container result

Depending on the number value (nm) I want to get a pic from a container field.

This is my calc (shortened)B)

Let (

[

Nm=P_weeknm;

High=User Season::WeekHigh;

Low=User Season::WeekLow;

Bar1=Graphic::Weekbars1;

Bar2=Graphic::Weekbars2;

Bar3=Graphic::Weekbars3;

Bar4=Graphic::Weekbars4;

Bar5=Graphic::Weekbars5;

Bar6=Graphic::Weekbars6

];

Case(

Nm < GetRepetition(High;1);

GetRepetition(

Bar1;Round (nm;0))

;

GetRepetition(

Bar2;Round (nm;0))

))

It works good if the nm value is below 11, but then it doesn't show anything.

If I only have one case() option (or skip it) I get good values (but then it's useless...)

example:

Let (

[

Nm=P_weeknm;

High=User Season::WeekHigh;

Low=User Season::WeekLow;

Bar1=Graphic::Weekbars1;

Bar2=Graphic::Weekbars2;

Bar3=Graphic::Weekbars3;

Bar4=Graphic::Weekbars4;

Bar5=Graphic::Weekbars5;

Bar6=Graphic::Weekbars6

];

Case(

1=1;

GetRepetition(

Bar2;Round (nm;0))

))

Does anyone now what I'm doing wrong?

Link to comment
Share on other sites

OK, didn't know about extend ..... maybe that's giving me some troubles ... and maybe my whole calc is a bad one ...

The case is this....

Nm = 52 rep

High = 6 rep

Low = 6 rep

Bar1 = 40 rep

Bar2 = 40 rep

Bar3 = 40 rep

Bar4 = 40 rep

Bar5 = 40 rep

Bar6 = 40 rep

... and the calc field has 52 reps

So all the fields have reps but only nm and calc field has 52. The extend function makes it possible to use a non-rep field (not the case here) if I've understood it correctly?

Link to comment
Share on other sites

Just a hunch - try, instead of this:

--------------------------------------

Case(

Nm < GetRepetition(High;1);

GetRepetition(

Bar1;Round (nm;0))

;

GetRepetition(

Bar2;Round (nm;0))

--------------------------------------

Let ( [

...

result1 = GetRepetition ( Bar1 ; Round (nm ; 0 ) ) ;

result2 = GetRepetition ( Bar2 ; Round (nm ; 0 ) )

] ;

Case(

Nm < GetRepetition ( High ; 1 ) ;

result1 ;

result2

)

)

Link to comment
Share on other sites

Ok, a couple of things:

1. I have rewritten your calc, and it appears to work. I cannot tell you if that is a result of the rewrite - I simply had to rewrite it, otherwise I had no idea what I was testing.

2. When you refer from a repetition of one repeating field to another repetition of another repeating field - you will experience refresh problems. After changing the data in High/Low, I had to re-enter the data in WeekTime in order to get the correct display.

I have no idea what this is supposed to do, but I would consider moving some of the data, especially the highs and lows, out of repeating fields.

test.fp7.zip

Link to comment
Share on other sites

I don't know if I have some filemaker settings set falsly but there is no

difference in my file. I don't get bars in every field that has a nm value in the corresponding rep..... And the bars I get ai'nt the correct ones...

switching of the global storing of the active data fields give me the correctly related weekvalues, thats one good thing...

I have no idea what this is supposed to do, but I would consider moving some of the data, especially the highs and lows, out of repeating fields.

smile.gif Well.....

The thing I'm trying to accomplish is the following

It's a simple planning layout for a user.

The Nm field is the time he well train, one rep for each week of the year (time is set by a number)

Then in his user settings he has specified that for an example a heavy training week for him is between 12-15 h

If it's a recovery week the calc should get a bar from the Bar1 field,

if it's an easy from bar2 etc

Link to comment
Share on other sites

I can't say I understand it completely, but I think you should consider:

(a) A record per user per week, instead of 52 repeats. For any kind of report, this will be essential.

(B) I would make the calculations work as pure numbers first, before dealing with the fancy display.

Link to comment
Share on other sites

This topic is 6993 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.