Use IF with topline

Hello bosses!

I would like to do an auto compute with the top line.

Long story short, it's a sports app for me and my friends.

We have two lines one with the weight and one with the question "did you fail?" Yes No

The goal is that the next time I open a form it fills itself out with the following condition:

If the last line the answer to "did you fail?" is No then it will fill in the weight used before +1.
Otherwise, it puts the weight back on.

I imagine it must be the select or maxrows function but I can't seem to formulate it.

0 12 318
12 REPLIES 12

Steve
Platinum 4
Platinum 4

Hello,

Since your message I have tried to document myself but I cannot find the formula that corresponds.
Because there is a column with text and a column with numbers.
I can't tell it "find the last value entered"

Assuming you have a table named "MyTable" and your mentioned form named "MyForm".

1. Create a new action.

2. In "Do this" option, choose "App: go to another view within this app".

3. In "Target", place this expression (don't forget to change MyForm, MyTable and KeyColumnOfMyTable to what you're actually using).

LINKTOFORM("MyForm",
   "Weight",
   IF(
      LOOKUP(MAXROW("MyTable", "_RowNumber"), "MyTable", "KeyColumnOfMyTable", "did you fail?") = "No",
      LOOKUP(MAXROW("TableName", "_RowNumber"), "TableName", "KeyColumnName", "Weight") + 1,
      LOOKUP(MAXROW("TableName", "_RowNumber"), "TableName", "KeyColumnName", "Weight")
)
)

4. In "Prominence", select "Display overlay"

Then save and try.

I have use this solution but it doesn't work. 

With the MAXROW expression, formula return the first column like that : 

MAXROW(Musculation,Pendlay,[Echec_Pendlay]=No)

 

One randomly chosen value from this list ( ........The list of values of column 'Unique ID' ........from rows of table 'Musculation' ........where this condition is true: (ALL these statements are true: ............1: (The value of column 'Echec_Pendlay') is equal to ("NO") ............2: (The value of column 'Pendlay') is equal to (MAX( ....................The list of values of column 'Pendlay' ....................from rows of table 'Musculation' ....................where this condition is true: ((The value of column 'Echec_Pendlay') is equal to ("NO"))))))

You would need to show us what table and its data look like or you would get just widely replies.

I've made a video hope this is clear ^^

Video 

Hope I understand correctly, try

LINKTOFORM("Musculation_Form",
   "Pendlay",
      IF(
         LOOKUP(MAXROW("Musculation", "_RowNumber"), "Musculation", "Unique ID", "Echec_Pendlay") = Yes,
         LOOKUP(MAXROW("Musculation", "_RowNumber", (ISNOTBLANK([Pendlay]))), "Musculation", "Unique ID", "Pendlay"),
         0
      )
)

If i wrote this in the initail value it doesn't work . In Action? 

IF(
   LOOKUP(MAXROW("Musculation", "_RowNumber"), "Musculation", "Unique ID", "Echec_Pendlay") = Yes,
   LOOKUP(MAXROW("Musculation", "_RowNumber", (ISNOTBLANK([Pendlay]))), "Musculation", "Unique ID", "Pendlay"),
   0
)

Samy_Kermia_0-1657807621495.png

.

Recheck my 1st reply. This's not for app formula but an action.

And great thanks for your help !!!!! ๐Ÿ˜

Top Labels in this Space