Forum Discussion
Remove rows from a Join Table
- 5 years ago
Hi Anonymous - you can use FILTER on the output of SELECTCOLUMNS to remove rows prior to the UNION happening.
FILTER ( SELECTCOLUMNS (...), [Filter Condition] )
You could also potentially use FILTER inside SELECTCOLUMNS by first filtering the base table, then choosing the columns
SELECTCOLUMNS ( FILTER ( [Table], [Filter Condition] ), ... )
Hope this helps
David
- 5 years ago
FILTER( TableName, NOT(TableName[ID_FW] IN {"xx", "yy", "zz"} ) )
should work (obviously if the IDs are numbers, don't need the quotes). If it isn't please share your error message or what behavior you are seeing.
Hope this helps,
David
FILTER( TableName, NOT(TableName[ID_FW] IN {"xx", "yy", "zz"} ) )
should work (obviously if the IDs are numbers, don't need the quotes). If it isn't please share your error message or what behavior you are seeing.
Hope this helps,
David
- Anonymous5 years agoNot applicable
dedelman_clng thanks for your tip, first of all. I've tried this one (in blue):
Spot_FW = UNION((SELECTCOLUMNS(UDM_DMO_FORWARD_VALOR,"ID_INDICE",UDM_DMO_FORWARD_VALOR[UDM_FORMULADOR_INDICES.ID],"Data_Cotacao",UDM_DMO_FORWARD_VALOR[DATA_COTACAO],"Cotacao",UDM_DMO_FORWARD_VALOR[VALOR],"ID_FW",UDM_DMO_FORWARD_VALOR[ID_FWD],"ID Spot","Not Spot","Prazo",UDM_DMO_FORWARD_VALOR[CONTRATO],"Validade",UDM_DMO_FORWARD_VALOR[ValidarContrato]), filter(UDM_DMO_FORWARD_VALOR,NOT (UDM_DMO_FORWARD_VALOR[ID_FWD] IN { 34, 24, 62, 32})),SELECTCOLUMNS(OMIE,"ID_INDICE",OMIE[ID_INDICE],"Data_Cotacao",OMIE[DATA_COTACAO],"Cotacao",OMIE[OMIE D+1],"ID_FW","Not FW","ID Spot",OMIE[ID_SPOT],"Prazo","Spot","Validade","0"),filter(SELECTCOLUMNS(UDM_DMO_SPOT_VALOR,"ID_INDICE",UDM_DMO_SPOT_VALOR[UDM_FORMULADOR_INDICES.ID],"Data_Cotacao",UDM_DMO_SPOT_VALOR[DATA_COTACAO],"Cotacao",UDM_DMO_SPOT_VALOR[VALOR],"ID_FW","Not FW","ID Spot",UDM_DMO_SPOT_VALOR[ID_SPOT], "Prazo","Spot","Validade","0"),[ID Spot]<>30)))Could you please give me any insight on this formula?Thanks in advancecheers - Anonymous5 years agoNot applicable
dedelman_clng Yes, you're right. I have reordered the code and it worked.
Thanks for your tips!
Cheers!