Hi,
Please could someone advise of the expression to get a list of just the green rows?
Something like:
[select_asset_type] are all the same as each other i.e. โCAT6Aโ
[room_sid] are all the same as each other i.e. โ2-624โ
[survey_status] are are same as each other?
[last_changed_on] rows are within 2 minutes of each other?
UseCase:
Thanks in advanceโฆ
Solved! Go to Solution.
Iโve included two new helper columns:
[number] - the number of the survey or grouped/related survey rows.
[previous] - the EnumList items from the form before it was saved and split into many.
That might make it easier for the expression to identify the groupโฆ?
In adding the helper columns I realise Iโve just answered my own question cause they make it easy to identify the most recent group of surveysโฆ It amazing how the act of presenting a question on this forum brings clarity and perspective to the issueโฆ
Thanks @Rich
Where is the user coming from when they start this new survey for the green rows?
Hi @Rich,
Iโm not sure I followโฆ?
I may have caused confusion above. The action is OnSave. The table is survey.
All surveys will always start from the survey tableโs survey form.
In real terms theyโll be in the same room (2-694) or may have moved into a new room?
When these rows are identified where is the formula being run? In this example above how do you know โCAT6Aโ and โ2-624โ are the values that need to be in the expression?
Good questionโฆ the thing is the CAT6A is a cable type and could also be one of two other cable types in the next or another survey (CAT6A, Fibre, Power).
My thinking was to add a new button to the form that asks if Iโm surveying a single [asset_name_text] (Asset Name) or if Iโm surveying multiple cables in [asset_name_text] i.e. (CAT6A, Fibre, Power)
They may be a bit of a red herring, but I thought itโd be a useful way to help isolate the [last_changed_on] rangeโฆ i.e the most recent batch of rows for the same [asset_name_type] where [last_changed_on] is withing 2 minutes of each other.
I could then use that list as my [asset_name_text] EnumList when I select the new 'surveying multiple cables button?
Hope that makes sense?
Clarification pointโฆ
The next survey would be the same [asset_name_text] as per the green rowsโฆ iโe Iโm going to survey those same things againโฆ
The gist of what Iโm trying to do is add two new buttons to do the following:
Two New Buttons: (Single Item) and (Multiple Assets)
(Single Item) would say โI remember what you surveyed the last time you surveyed a single itemโ
(Multiple Assets) button would say โI remember what you surveyed the last time you surveyed multiple itemsโ
Do you have an asset table? My recommendation would be to have the survey table ref back to a record, that way you could easily query the questions. It would be fairly expensive to have AppSheet compare each record to all other records. Not saying it canโt be done but it could slow down your app.
If you did want to have an expression that compared each record to every other record this would probably work for you.
select(survey[id], count(select(survey[last_changed_on], and([select_asset_Type]=[_thisrow].[select_asset_Type], [room_sid]=[_thisrow].[room_sid], [last_changed_on]>=[_thisrow].[last_changed_on]-โ000:02:00โ, [last_changed_on]<=[_thisrow].[last_changed_on]+โ000:02:00โ)))>0)
This formula will calculate a select statement for each record in the table, and count if there are any records that match the criterion you wanted above. For any given record if it counts more than zero matches then that recordโs id will be returned.
Hi @Richโฆ Thanks a million for above suggestionโฆ Iโm going to get stuck in and see how I get on with that and Iโll report back with progress.
On the processing burden issueโฆ You have a good pointโฆ I do have an asset table with a Ref column in this survey table called [asset_id] and there is also an [asset_name] and [asset_type] column in the asset table.
I wouldnโt know where to start to do this and involve the asset tableโฆ? Is it trickyโฆ? I can post screen shots of the tables if you donโt think itโll be too difficult?
Thanks againโฆ
Hi @Rich,
I have your expression working in a VCโฆ
Thanks for your time and for pointing me in the right direction.
SELECT(survey[id],
COUNT(
SELECT(survey[last_changed_on],
AND(
[select_asset_type]=[_thisrow].[select_asset_type],
[room_sid]=[_thisrow].[room_sid],
[last_changed_on]>=[_thisrow].[last_changed_on]-โ000:02:00โ,
[last_changed_on]<=[_thisrow].[last_changed_on]+โ000:02:00โ
)))>0)
Iโm having a little trouble changing the logic to return a slightly different result and wonder if you could shed some light pleaseโฆ?
The current expression returns all survey results if any survey was completed within 2 minutes.
Ideally, Iโd like to see - if possible:
By starting to look from the bottom up, Iโm trying to catch the โmost recentโ group of surveys to show them in an EnumList.
Thanks in advanceโฆ Cheersโฆ
Iโve included two new helper columns:
[number] - the number of the survey or grouped/related survey rows.
[previous] - the EnumList items from the form before it was saved and split into many.
That might make it easier for the expression to identify the groupโฆ?
In adding the helper columns I realise Iโve just answered my own question cause they make it easy to identify the most recent group of surveysโฆ It amazing how the act of presenting a question on this forum brings clarity and perspective to the issueโฆ
Thanks @Rich
User | Count |
---|---|
17 | |
12 | |
5 | |
5 | |
5 |