Formula issue
- pirinisz
- 1 yr ago
- 35replies
- Answered
Hey guys, I have the following problem:
I'm using a formula which shows data from a table with two columns, let's say column1: "title" and column2: "organisation". I want the formula to show the records one at a time, meaning "title1+organisation1" + "title2+organisation2" etc. Instead it shows "title1+title2 etc"+"organisation1+organisation2 etc".
PLEASE HELP!!!!
Thank you very much!!!
35 replies
-
- Ninox partner
- RoSoft_Steven.1
- 1 yr ago
- Reported - view
Can you post your formula you already have for more insight of what you want?
-
- pirinisz
- 1 yr ago
- Reported - view
It's something like: 'table'.'title'+" "+'table'.'organisation'
-
- pirinisz
- 1 yr ago
- Reported - view
pirinisz so if the table has one record title1-organisation1 then the formula will show title1 organisation1. But if there are 2 or more records, then the formula shows title1 title2 organisation1 organisation2. But I want to show tilte1 organisation1 - title2 organisation2 etc
-
- Ninox partner
- RoSoft_Steven.1
- 1 yr ago
- Reported - view
pirinisz You could try something like:
join(for i in table do i.title + " :" + i.organisation end, " ")
Be aware that your formula field has to be minimum 2 lines high because everything would be on the same line.
-
- pirinisz
- 1 yr ago
- Reported - view
RoSoft_Steven OK I'll give it a try and let you know! Thanks man!!
-
- pirinisz
- 1 yr ago
- Reported - view
pirinisz It kind of works. There is just another issue that came up: the field "organisation" is actually another table so if there are 2 titles on the same organisation, then formula shows them both. Let me give you an example:
We have organisation1 and organisation2.
In organisation1 we have title1 and title2 (2 different records of the database).
In organisation2 we have title1.
With the given code the formula shows
title1title2 organisation1 and title1 organisation2.
Other than that, it works just fine.
By the way, what if I have a 3rd field to add, how should I change the code?
-
- Ninox partner
- RoSoft_Steven.1
- 1 yr ago
- Reported - view
pirinisz
you could extend the loop and the join like :
join(for i in table do i.title + " :" + join(for p in i.organisationtable do p.organisation end," / ") end, " ")
You have an idea of how the join works now so you can tweak the formula if necessary....
Not sure if this is what you want, for more correct details, I would ask you for screenshots of your table and field layouts.
Don't hesitate for more explanation if needed.
-
- pirinisz
- 1 yr ago
- Reported - view
RoSoft_Steven I would send you but everything is in Greek, not sure if you'd understand!!!
So I'll try to explain it as simple as possible:
Table1 "organisations" with a field "name".
Table2 "positions" with a field "position" and a reference to table1.
table3 "contacts" with a reference to table2 which contains 2 collums "position" and "name" (from table1).
So in table3 I have 2 records: Steven and pirinisz.
Steven works for organisationA, as positionA.
pirinisz works for organisationA, as positionB and for organisationB as positionC.
I want the formula to show all the positions that each contact works for,
but instead for pirinisz it shows positionA positionB organisationA and positionC organisationB.
I hope I made it clear for you man!!
-
- Fred
- 1 yr ago
- Reported - view
pirinisz actually it would help to see the full DB since we need to see the formulas and relationships. Plus we will all learn a bit of Greek along the way.
-
- Ninox partner
- RoSoft_Steven.1
- 1 yr ago
- Reported - view
Fred pirinisz True what Fred said... So we can see the relationship between the tables.
-
- pirinisz
- 1 yr ago
- Reported - view
RoSoft_Steven Actually guys, I'm a little embarrased cause my data model is a MESS!!! I'm still working with trying to make things a little more simple!!!!
-
- Fred
- 1 yr ago
- Reported - view
pirinisz don't worry, we don't judge. my data model for my main db is also a mess as it has grown organically as I've learned. If I redid everything it would be cleaner.
-
- pirinisz
- 1 yr ago
- Reported - view
Fred Ok guys, here's
a screenshot of my data model!!
What else do you need?
-
- Fred
- 1 yr ago
- Reported - view
pirinisz Can you upload a sample of your full DB? Save it as an archive then upload it here.
We only need a sample data so you don't need to give us every record.
-
- pirinisz
- 1 yr ago
- Reported - view
Fred How do I do that guys???
-
- pirinisz
- 1 yr ago
- Reported - view
pirinisz Maybe duplicate the db and make the appropriate deletions etc???
-
- Fred
- 1 yr ago
- Reported - view
pirinisz that is a good start.
if you mouse over the top right corner of your DB you will see a down arrow. click on that then select Save as archive. then open do a reply and click on the paperclip icon to upload the db.
-
- pirinisz
- 1 yr ago
- Reported - view
Fred yes but that will archive the whole db! Talking about a 4gb file
-
- pirinisz
- 1 yr ago
- Reported - view
pirinisz give me 5, I'll send a sample
-
- pirinisz
- 1 yr ago
- Reported - view
pirinisz it's ready
-
- Fred
- 1 yr ago
- Reported - view
pirinisz While my Greek comes up to speed, can you tell us which tables/fields we should focus on?
-
- pirinisz
- 1 yr ago
- Reported - view
pirinisz I'm here for any clarifications.... thank you guys!!!
-
- Fred
- 1 yr ago
- Reported - view
pirinisz Can you take Steven's code an put in your table/fieldnames and post it? That will help us a lot.
-
- pirinisz
- 1 yr ago
- Reported - view
Any luck you guys????
Content aside
- Status Answered
-
1
Likes
- 1 yr agoLast active
- 35Replies
- 227Views
-
3
Following