Select Where Function - Please Help!
PLEASE HELP!!!
Please see the data model in the attachment below:
I have a table called Static Site Data, Risks and Mitigation Cost per Site, Type Specific Risks, and Risk List..
Static Site Data only shows the details of the site which information needs to be linked to a Report (this report is in a form of another table. The Report will be for each site.)
Risks and Mitigation Cost per site is the big table that is linked to the Static Site Data which calls the names of the sites, showing the type of the site, and the risks.
Type Specific Risks is a table which contains a list of types. Each Type is then linked to the Risk List.
I made a one to many function. A one in the Type Specific Risks and a many in the Risk List... Because 1 type, or 1 row in the Type Specific Risk Table has more than 1 risks, hence making the one to many relationship to the Risk List table
select 'Static Site Data'.'Risks and Mitigation Costs per Site'.'Type Specific Risks'.'Risk List1' where 'Risk List'.Id = 'Column 1'
Why is this code wrong? the function "where" in underlined red by ninox
15 replies
-
When you do a select command you can only filter at the first table level.
I'm guessing, from other posts and your picture, that 'Risk List1' is not a table so you can not do a select on a record. You have a table called Risk List so you can use that in your select:
let t := this; select 'Risk List' where Id = t.'Column 1'
There is a way to use reference fields in your filters, but for now let us keep it simple.
-
said:
select 'Check Ins' where 'Radio Net Date' >= xBeg and 'Radio Net Date' <= xEnd [with no ending ")" ]
BUT 'BegDat' Field = Aug 1, 2023 and 'EndDat' Field = Sep 23, 2023.I'm not sure what you are doing here. What is the BUT part?
said:
This formula does produce a window with the array of ALL data in 'Check Ins' showing [1077 records]:
select 'Radio Nets'.'CheckIns'
whereas, this formula produces a window with an array of only the first 21 records of data showing:
select 'Check Ins'Just to verify that Radio Nets.CheckIns is pointing to the 'Check Ins' table. Unless you changed the name, Ninox will have kept the same name for the reference field as the table. If they are not pointing to the same table then you need to change to the correct table.
-
said:
The BUT is that I am NOT getting this, but ZERO. Trying to figure out where/how I am going astray?Ok, this is where having the DB is handy. Your field Radio Net Dates in Check In is not a date field it is a relationship field. Which means that when you select a date, you are actually selecting the record.
If you create a new formula field in Check In and put this in it:
debugValueInfo('Radio Net Date')
It will return: rid(1) <- or whatever number is appropriate.
To make things easy, create a new formula field in Check In, call it Date, and put this in it:
'Radio Net Date'.'Radio Net Date'
Now go back to your Dashboard and modify your view element code to:
let xBeg := BegDat; let xEnd := EndDat; select 'Check Ins' where Date >= xBeg and Date <= xEnd
And you should get what you want now that you are comparing date data to date data.
Content aside
- 1 yr agoLast active
- 15Replies
- 303Views
-
3
Following