Marc_Dillon:
auto> LIST(> IFS( [Patient Ref Key].[Pulmonary oedema] , "Pulmonary oedema" ) ,> IFS( [Patient Ref Key].[ICU Admission] , "Intensive care admission" ) ,> ...> )> >
Hi, Thank you very much @March_Dillon for your reply.
Actually, “Delivery Outcomes” table and “Admissions for Delivery” table are not mother/child tables, instead, both of them are child tables of a mother table called “Patient Bank”. Both “Delivery Outcomes” and “Admissions for Delivery” tables have a [Key] column as the Key column, and [Patient Ref Key] column that references each of them to the “Patient Bank”. So for a particular patient, the [Patient Ref Key] in both of these tables are always the same value.
Therefore, IFS( [Patient Ref Key].[Pulmonary oedema] , “Pulmonary oedema” ) wouldn’t work in my case.
Unfortunately, I couldn’t get the initial value of the EnumList type column to preselect several values based on the data in other tables.
The thing is, the following expression is accepted by AppSheet, but it’s just that it would only preselect the first expression in the IFS (as in only the “Pulmonary oedema”), and the other one doesn’t get selected even if the condition is true.
Blockquote
IFS((CONTAINS(SELECT(Admission for Delivery[Pulmonary oedema], [_THISROW].[Patient Ref Key] = [Patient Ref Key]),Y),“Y”),“Pulmonary oedema”,
(CONTAINS(SELECT(Delivery Outcomes[ICU admission], [_THISROW].[Patient Ref Key] = [Patient Ref Key]),Y),“Y”),“Intensive care admission”)
If I swap the first IFS with the second IFS, and writes the expression as…
Blockquote
IFS((CONTAINS(SELECT(Delivery Outcomes[ICU admission], [_THISROW].[Patient Ref Key] = [Patient Ref Key]),Y),“Y”),“Intensive care admission”,
(CONTAINS(SELECT(Admission for Delivery[Pulmonary oedema], [_THISROW].[Patient Ref Key] = [Patient Ref Key]),Y),“Y”),“Pulmonary oedema”)
…then the “Intensive care admission” in the EnumList gets highlighted (as in preselected), but the “Pulmonary oedema” wouldn’t.
Anyway, I created a few virtual columns inside the “Delivery Outcomes” table where each of them gets filled by a value “Y” if the conditions in different tables are fulfilled, and then wrote an expression to the initial value of the EnumList column as in
Blockquote
IFS([Pulmonary oedema_VC]=“Y”,“Pulmonary oedema”,[Intensive care admission_VC]=“Y”,“Intensive care admission”)
but still, only the first one gets highlighted in the EnumList column. I even made a LIST as you suggested, but still, it returned the same.
So I’m thinking if it’s not possible to automatically preselect multiple values in an EnumList column (via “initial value”) in AppSheet? Would value your opinion.
@Steve @Aleksi @Suvrutt_Gurjar