Forum Discussion
Gilson_Souza
4 years agoFrequent Visitor
Return value based on hour range
Hi, everyone! I need some help, please. I have two tables that have the listing of events that occurred at certain times. Here's a simplified version of the data file: Table A: Table B:...
- 4 years ago
Gilson_Souza create this caclculated column in table A:
ID = VAR _current_cod = 'Table A'[COD] VAR _current_date_time_a = 'Table A'[DATETIME] VAR _table = FILTER( 'Table B', VAR _current_date_time_b = 'Table B'[DATETIME] RETURN 'Table B'[COD] = _current_cod && ABS(_current_date_time_a - _current_date_time_b ) <= 0.083333333 ) VAR _result = CONCATENATEX(_table, 'Table B'[ID]) RETURN _result - 4 years ago
Gilson_Souza write this:
ID = VAR _current_cod = 'Table A'[COD] VAR _current_date_time_a = 'Table A'[DATETIME] VAR _table = FILTER ( 'Table B', VAR _current_date_time_b = 'Table B'[DATETIME] RETURN 'Table B'[COD] = _current_cod && _current_date_time_a - _current_date_time_b <= 0.0416666667 && _current_date_time_a - _current_date_time_b >= - 0.125 ) VAR _result = CONCATENATEX ( _table, 'Table B'[ID] ) RETURN _result
SpartaBI
4 years agoCommunity Champion
Gilson_Souza create this caclculated column in table A:
ID =
VAR _current_cod = 'Table A'[COD]
VAR _current_date_time_a = 'Table A'[DATETIME]
VAR _table =
FILTER(
'Table B',
VAR _current_date_time_b = 'Table B'[DATETIME]
RETURN
'Table B'[COD] = _current_cod && ABS(_current_date_time_a - _current_date_time_b ) <= 0.083333333
)
VAR _result = CONCATENATEX(_table, 'Table B'[ID])
RETURN
_result
Gilson_Souza
4 years agoFrequent Visitor
SpartaBI Worked perfectly! I have no words to thank you, I was trying to solve this for days. Thank you very much!
- SpartaBI4 years agoCommunity Champion
Gilson_Souza my pleasure 🙂