LINKTOFILTEREDVIEW Help

Hello all,

Iโ€™m having some trouble writing this expression. Hereโ€™s what I need:

I have an action button inside the view ANIMAL_DETAIL.
Lets suppose Iโ€™m seeing the details of a female dog named โ€œAnnieโ€

Every animal has its father and mother (references to the same table - to another animals). So, in this view, Im gonna show all animalโ€™s โ€œkidsโ€. (in the example, all annieโ€™s kids)

So, I want the linktofilteredview to go to the โ€œKidsโ€ view (thatโ€™s working), and to compare the Animalโ€™s name from previous view (ANIMAL_DETAIL) to all data in the google sheets.
If the animal in the previous view (animal_detail) is a female animal, to find all animals that have their mother named the name in the previous view (annie).
If itโ€™s a male, all the animals whose fathers have its name.

Iโ€™m having trouble because I donโ€™t know how to get the info (annieโ€™s name) from the previous view I was on.

Iโ€™m not sure if itโ€™s too confusing, english is not my first language heheโ€ฆ Anyway, if itโ€™s needed, I can explain it again

Thank you all

Solved Solved
1 7 189
1 ACCEPTED SOLUTION

This can be tricky but we can use 2 Actions to solve this.

This will work according to Sex of Parent animal.
You have a child table with kids Father and Mother

Action 1:
We would use sex of parent animal as MALE.
That means this animal is always FATHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(โ€œViewNameOfLookuptableโ€,
in([Lookuptable ID],
  select(Lookuptable Name[Lookuptable ID],
  [PAI]=[_THISROW].[YOUR ROW ID]
        )
   )
)

Condition for this action would be [sex]="Male"

Same applies for Action 2 also but with a bit changes.

Action 2:
We would use sex of parent animal as FEMALE.
That means this animal is always MOTHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(โ€œViewNameOfLookuptableโ€,
in([Lookuptable ID],
        select(Lookuptable Name[Lookuptable ID],
        [Mรฃe]=[_THISROW].[YOUR ROW ID]
          )
    )
)

Condition for this action would be [sex]="Female"

This will switch the action according to the parent sex and lookup tables according to father and mother ID and show kids related to this Animal.

Hope this Helps.

View solution in original post

7 REPLIES 7

Try using this Function in LINKTOFILTEREDVIEW()

A combination of IN() and SELECT() Could solve your problem. If you can show me your table structure I can help you with that.

You can use below expression for your reference.

LINKTOFILTEREDVIEW("ViewNameOfLookuptable",
in([Lookuptable ID],
         select(Lookuptable Name[Lookuptable ID],
                      [Column to check]="Kids"
              )
       )
 )

Sure, here it goes (Its in portuguese, so I translated in the post)

3X_f_9_f95b41a9003006f541c107641c90d2aebecc0fea.png
Pai = father
Mรฃe = mother
Nome completo = complete name (its a concatenation between some names + indentifying codes)

3X_9_f_9fae4f485ce8d25ff8fc51d973c4971c61a13bf6.png

Ver Filhos = see kids
In the fields Pai and Mรฃe, its shown the complete name of both

Whenever clicking in the action โ€œVer filhosโ€ It should open a new view with all kids from the animal shown in this view

Is it enough to you understand ? or its missing something ? in the table structure

Thank you again

Blockquote
Column to check]=โ€œKidsโ€

The problem with this, I dont have a column named Kids, because one animal can have a lot of kids. The connection I have is: all animals refers to a father and a mother, but the mother and father have no connection to their kids. So I have to find their kids finding where they are put as father/mother in the sheets.

3X_0_1_0123ce6c6b8630386746baaaf12b386216ffc091.png

something like that

edit : for example:

I have to find โ€œAnnieโ€™s kidsโ€, so I have to search in the sheets any other animals who have Annieโ€™s ID as their mother.

I dont have a column or a table that I could pull annieโ€™s kids from there, I have to do a search in all mothers and find annieโ€™s ID on it, and select those rows to show in the view

Can you show me your kids table ?

This can be tricky but we can use 2 Actions to solve this.

This will work according to Sex of Parent animal.
You have a child table with kids Father and Mother

Action 1:
We would use sex of parent animal as MALE.
That means this animal is always FATHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(โ€œViewNameOfLookuptableโ€,
in([Lookuptable ID],
  select(Lookuptable Name[Lookuptable ID],
  [PAI]=[_THISROW].[YOUR ROW ID]
        )
   )
)

Condition for this action would be [sex]="Male"

Same applies for Action 2 also but with a bit changes.

Action 2:
We would use sex of parent animal as FEMALE.
That means this animal is always MOTHER.

Here we use an action to go another table view.

LINKTOFILTEREDVIEW(โ€œViewNameOfLookuptableโ€,
in([Lookuptable ID],
        select(Lookuptable Name[Lookuptable ID],
        [Mรฃe]=[_THISROW].[YOUR ROW ID]
          )
    )
)

Condition for this action would be [sex]="Female"

This will switch the action according to the parent sex and lookup tables according to father and mother ID and show kids related to this Animal.

Hope this Helps.

Thank you ! โค๏ธ

Worked perfectly

Top Labels in this Space