2017-12-22 2 views
1

메인 쿼리를 람다로 옮겨서 메인 쿼리를 읽기 쉽도록하려고합니다.람다를 사용하여 테이블 확장하기

그래서 나는이 같은 논리를 먹고 싶어 :

T //columns: operation_Name 
| extend path_Label = iif(operation_Name == '/', 'home', 'other') 
//end up with columns: operation_Name, path_Label 

을 그리고 람다에 iif 논리를 이동 싶습니다 또한 시도

let translate_path = (operation_Name: string) 
{ 
    iif(operation_Name == '/', 'home', 'other') 
}; 
T 
| extend path_Label = invoke translate_path(operation_Name) 

:

let translate_path = (T:(operation_Name: string))` 
{ 
    T | extend path_Label = iif(operation_Name == '/', 'home', 'other') 
}; 
T 
| invoke translate_path() 

답변

1

"invoke"를 추가 할 필요가 없습니다. 첫 시도는 문제없이 잘 작동해야합니다.

let translate_path = (operation_Name: string) 
{ 
    iif(operation_Name == '/', 'home', 'other') 
}; 
T 
| extend path_Label = translate_path(operation_Name) 
관련 문제