I import races into Excel but it has grown to a large spreadsheet and has its limitations.
I have successfully imported a small test database of results.
So far I have the form in the database with the tables and relationships below but when I try to make a layout to view the form I get the horse name and 1 line of form, when I scroll down the same horse displays again with it's next run.
I think it's because I have failed to fill the foreign keys in the horse_Race table, or got the relationships wrong.
I also want to add a Today's runners table but am not sure how to relate it to the existing tables Is it possible to achieve these aims in filemaker or am I barking up the wrong tree. I am at an Impasse but I'm sure it's to do with the relationships somewhere?
Tables as follows:
> -Course:-
pk_Course_ID, Course,
Horse:-
pk_Horse_ID,Horse
Races:-
pk_Race_ID,Course,Rdate,Rtime,Going,Age,Furs,Class,Ran,
- ***Horse_Race;-
pk_Run_ID,fk_Course_ID,fk_Horse_ID,fk_Races_ID,Course,RDate,Rtime,Going,Age,Furs,Class,Ran,Pos,Drw,TBtn,Horse,Wgt,MARK,GRD,WA,AA,BHB,BHBAdj,RATING,PPL
Relationships from primary key in each table to foreign keys in Horse_race table.
My aims are as follows.
To view EACH individual horse and its FORM in date order latest run at the top
AJCook (IRE)
DATE CRSE Going Furs Class Ran Pos Drw TBtn Wgt
MARK GRD RATING
31-Jul-13 REDC GD 6 6 11 11 1 20.8 133 65 63 -1
08-Jul-13 RIPO GF 6 6 11 7 3 8.25 133 65 65 41
21-Jun-13 REDC GF 5 5 5 1 4 0.02 133 60 56 54
28-May-13 REDC GF 6 5 13 5 6 5.35 124 61 70 35
06-May-13 BEVE GF 5 5 12 8 13 6.15 125 65 73 40
To add a todays runners table with races and runners from each of the days races that would loop through each horse and search the database to display the horses and their last 3 ratings latest on the right plus the TOP 9 RATINGS FROM THE LAST 3 RATINGS IN ORDER like so:-
HORSE R1 R2 R3 HORSE RATE
A J Cook (IRE) 54 41 -1 Abadejo 57
Aaranyow (IRE) 45 36 48 Abadejo 56
Aarti (IRE) 44 43 40 A J Cook (IRE) 54
Aazif (IRE) 46 43 23 Abadejo 54
Abadejo 56 54 57 Aaranyow (IRE) 48
How do I add the todays runners table which has the following data
Date Time,Course,Furs,HorseNo Horse
How will it be related to the tables I already have? Many thanks
Davey H
FileMaker can easily do this. But I am a bit confused with your blocks of text up there, can you format them a little better so that I can see what tables hold which fields please?
Related
I have noticed when using xasc capital letters take precedence over lower case.
Trying to exclude Total from being considered when doing the sort, wanting to avoid using "lower" then recapitalizing it again. I have my solution below but its rather poor code
t:flip (`active`price`price2)!(`def`abc`xyz`hij`Total;12j, 44j, 468j, 26j, 550j;49j, 83j, 716j, 25j, 873j)
Thinking there's a better way than this
(`active xasc select from t where not active=`Total),select from t where active=`Total
Although it does not match the sort order of your example answer, if you're looking to sort by true lexicographical order excluding captials you could do the following:
q)t:([]active:`def`abc`xyz`hij`Total;price:12 44 468 26 550;price2:49 83 716 25 873)
q)t iasc lower t`active
active price price2
-------------------
abc 44 83
def 12 49
hij 26 25
Total 550 873
xyz 468 716
Otherwise, if you're looking to have the Total row at the bottom following the sort then you will need to append it after doing so - given your example table:
q)(select[<active]from t where active<>`Total),select from t where active=`Total
active price price2
-------------------
abc 44 83
def 12 49
hij 26 25
xyz 468 716
Total 550 873
There isn't really a much cleaner way to do it, but this approach ensures Total is at the bottom without needing two selects (but it needs a group and a sort)
q)raze`active xasc/:t group`Total=t`active
active price price2
-------------------
abc 44 83
def 12 49
hij 550 873
xyz 26 25
Total 468 716
Matthew's is probably the best all-round solution.
If you know Total is always going to end up first after the sort then:
{1_x,1#x}`active xasc t // sort, join the first row to the end, drop first row
is a pretty concise solution - this is obviously not ideal if you don't have control over the active column contents as other uppercase entries would make this unpredictable.
My data is like below in one column coming from a file.
Source_data---(This is column name)
CUSTOMER 15
METER 8
METERStatement 1
READING 1
METER 56
Meterstatement 14
Reading 5
Reading 6
Reading 7
CUSTOMER 38
METER 24
METERStatement 1
READING 51
CUSTOMER 77
METER 38
READING 9
I want the output data to be like below in one column
CUSTOMER 15 METER 8 METERStatement 1 READING 1
CUSTOMER 15 METER 56 Meterstatement 14 Reading 5
CUSTOMER 15 METER 56 Meterstatement 14 Reading 6
CUSTOMER 15 METER 56 Meterstatement 14 Reading 7
CUSTOMER 38 METER 24 Meterstatement 1 Reading 51
CUSTOMER 77 METER 38 'pad 100 spaces' Reading 9
I am trying to solve by reading transformer looping documentation but could not figure out an actual solution. anything helps. thank you all.
Yes this could be solved within a transformer stage.
Concatenation is done with ":".
So use a stage variable to concat the input until a new "Meter" or "Customer" row comes up.
Save the "Customer" in a second stage variable in case it does not change.
Use a condition to only output thew rows where a "Reading" exists.
Reset the concatenated string when a "Reading" has been processed.
I guess you want the padding for missing fields in general - you could do these checks in separate stage variables. You have to store the previous item inorder to kow wat is missing - and maybe even more if two consecutive items could be missing.
I have a tool that every x hours creates a y set of lines that I would simply like to add to a column into a specific smartsheet. And then every x hours I would simply like to overwrite these values with the new ones. That can have a different numbers of lines.
As I read the API in order to add or update anything I need to get all the row and columne IDs of the smart sheet in question.
Isn't there a easy way to formulate a JSON with a set of data and columne name and it just auto adds the rows as needed?
Data example is:
21
23
43
23
12
23
43
23
12
34
54
23
and then it could be:
23
23
55
4
322
12
3
455
3
AUTO
I really find it hard to believe that I need to read so much information into a script to be able to add just row of data. Nothing fancy.
Looking into sticking to just using cURL or Python
Thanks
If you want to add this data as new rows, this is fairly simple. It's only if you would like to replace existing data in existing rows where you would need to specify the row id.
The python SDK allows you to specify just a single column id, like so:
row_a = smartsheet.models.Row()
row_a.cells.append({
'column_id': 642523719853956
'value': 'New Status',
'strict': False
})
For more details, please see the API documentation regarding adding rows.
I have two datasets that are formatted differently
data1 looks like:
data1:
YYMM test1
1101 98
1102 98
1103 94
1104 92
1105 99
1106 91
data 2 is just a single grand mean that looks like:
data2:
GM
95
I would like to combine the two and have something that looks like this:
WANT:
YYMM test1 GM
1101 98 95
1102 98 95
1103 94 95
1104 92 95
1105 99 95
1106 91 95
I'm sure there are different ways to go about configuring this but I thought I should make the 95 into a column and merge with data1.
Do I have to use macro for this simple task? Please show me some light!
One straightforward way is to just merge without by statement and the use of retain:
data WANT (drop=temp);
merge DATA1 DATA2 (rename=(GM=temp));
retain GM;
if _N_=1 then GM=temp;
run;
So basically you put the two datasets together.
Because there is no by-statement, it will join together the first record of both datasets, the second record of both datasets and so on.
At the first record (if N=1), you grab the average and you put it in a variable for which the last value will be remembered (retain GM).
So in record 2, 3 etc, the value will still be what you put into it at record 1.
To keep it all clean, i renamed your GM variable on the input, so it was available to use as name for the retained variable. And of course, i dropped the redundant variable.
You can also approach this issue with a macro variable or a proc sql. But better keep it simple.
Here's a similar way that's slightly simpler.
data want;
set data1;
if _n_=1 then set data2;
run;
I am not much familiar with Crystal Reports. I facing one issue regarding the Detail fields in Crystal report.
Lets assume I have 5 fields in Details band.
Field a, b, c, d, e and the record set for the below fields will be as below
A B C D E
111 1 20 30 222
111 1 21 31 222
111 1 22 32 222
111 2 11 11 222
111 2 12 12 222
111 2 13 13 222
Now I need to display the details by grouping the field B and get the sum for C and D. And at the end my result should be as below
A B C D E
111 1 20 30 222
21 31
22 32
------- ------
Total 63 93
111 2 11 11 222
12 12
13 13
------- ------
Total 36 36
Can some one help me how do I do this kind of Stuff.
You should use the group option (Insert --> Group) and select field B.
Then, use running total to sum the wanted fields. (View --> Field Explorer, then, on the field explorer right-click on 'Running Total Fields' --> New). Create the wanted running total using this expert and then drag into your report in order to show it.
Insert text boxes as needed for the caption of the group header and "Total".
Urik is correct !
I just want to add some points as par the output user1464855 want.
Add groups for two columns field A , field B . add these fields in the detail section also add the C, D and E in
the section.
To display Total you can use either of the following ways
a. you can add new "Running Total field" for Columns C and Column D as Urik said.
b. you can right click on the field "C" and select "Insert --> Summary" then select the field "C" select the "sum"
and select the summary location "Group # 2" in "Insert Summary" dialoge box and click "OK".
To avoid displaying the duplicate values (repeatation of values) select the field on the report e.g. field "E"
right click on it Select "Format field" select "Common" Tab select check box "SUppress of Duplicated".
you can repetae this step for other fields A, B.
I hope this will help you. kindly correct me if I am wrong !