Forum Discussion
Remove rows based on another table
- 5 years ago
Chavas , In most of the connection, you have an advance option, you can give a query there. so add this query using new connection route
Hi Greg_Deckler . Thanks for your answer.
I have been looking for the solution but I should be doing something wrong because the RELATED function is not being accepted by the New Column editor.
I have a table such as:
| TICKET TABLE | |
| ID | Status |
| 1 | A |
| 2 | B |
| 3 | C |
With 1M Records. I have filtered to filter all with status C. So it just speed up my refresh process because it only process 500 rows.
I have also the Task table:
| TASK TABLE | ||
| ID | Ticket ID | Status |
| 1 | 1 | A |
| 2 | 1 | B |
| 3 | 3 | C |
This one haves let's say 5M rows, and I need to filter it and only keep the data of the Tickets which are relevant (The ones that where not filtered before) In this case, Task with ID 3 should be removed. so instad of processing 5M entries, I will just process 5K.
I have tried to create a new column, but each formula I set to try to get the data it does not work, the IDE does not let me set a VLOOKUP or Related formula even an IF.
Simpliet way is pseudo code will be creating a new column:
If (Exists in Ticket Table (ID=Task.TicketID), 1,0)
DELETE ROW IF Exists=0
Chavas - If you are having issues with RELATEd, try RELATEDTABLE instead.
- Chavas5 years agoHelper II
- Greg_Deckler5 years agoCommunity Champion
Chavas - Oh, you are in Power Query, sorry, those commands I mentioned are DAX. Well, in Power Query, did you try the Left-Anti or Right-Anti joins? Let me look at this with a fresh set of eyes.
- Chavas5 years agoHelper II
Thank you both ( Greg_Deckler and amitchandak ) for your assistance, what I am trying, it is something like this
SELECT TaskID, DATABASE.dbo.Ticket.TicketID, DATABASE.dbo.Ticket.Status FROM DATABASE.dbo.Task
inner join Database.dbo.Ticket on DATABASE.dbo.Task.ParentID=Ticket.ID
WHERE Ticket.Status != 'Closed'
So I have already filtered the Ticket table but I wont to prevent loading tons of rows which I do not need and I am not going to use it. So I do not need to have on a new table all the info of the Tickets, you know? I would like to keep it separated and then I will manage it through the relations.I might posted it in the wrong forum :S And sorry for the confusion
- amitchandak5 years agoSuper User