테이블 계산을 만들 수 있는 적절한 권한이 있으면 Looker 함수 및 연산자를 사용하지 않고도 Explore의 데이터 테이블에 있는 숫자 필드에서 일반적인 계산을 수행할 수 있는 바로가기 계산을 사용할 수 있습니다.
또한 테이블 계산을 직접 총계 행의 값에 적용할 수 있습니다.
총계 행의 계산이 혼동될 수 있는 이유
이 페이지의 예시와 설명은 다음 Explore 쿼리의 예시를 기반으로 합니다: 주문 항목 수, 사용자 수, 사용자당 주문 항목 및 총계 옵션이 적용된 주문 생성일별로 그룹화된 평균 주문 항목.
사용자당 주문 항목의 총계는 4.5로, 이는 예상되는 반올림 총계 54,767(주문 항목 총계)을 12,290(사용자 수 총계)으로 나눈 값입니다.
평균 주문 항목의 총계는 54,767로, 이는 주문 항목 수 총계(54,767)를 1로 나눈 값이며, 사용자에게 표시하는 것이 의미가 없을 수 있습니다.
테이블 계산 사용 문서 페이지의 테이블 계산 사용 고려사항 섹션에서 설명한 것과 같이 테이블 계산은 데이터 열의 값이 아닌 하나의 총계 행을 기준으로 총계를 계산합니다. 사용자당 주문 항목 테이블 계산 총계와 같은 일부 계산의 결과는 명확하게 이해할 수 있습니다.
그러나 집계를 수행하는 테이블 계산(예: percentile 및 median을 사용하는 계산)은 Explore 예시의 평균 주문 항목 총계와 같이 복잡한 방법으로 총계를 계산할 수 있습니다.
총계 행에서 계산 총계를 null 기호로 바꾸기
테이블 계산 총계가 혼동될 가능성이 있는 경우 다음 테이블 계산 표현식을 사용하여 총계 중 하나를 null 기호로 바꿀 수 있습니다. my_grouping_dim을 그룹화 측정기준으로, table_calc를 총계 행에 null을 표시하려는 테이블 계산으로 바꿀수 있습니다.
if(is_null(my_grouping_dim), null, <table_calc>)
이전 표현식을 평균 주문 항목 테이블 계산에 적용하면 테이블 계산은 데이터 테이블 총계 행에 평균 주문 항목 총계에 대해 null 기호를 표시합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-31(UTC)"],[],[],null,["# Display potentially confusing table calculation totals as nulls\n\n\u003e When you have the appropriate [permissions](/looker/docs/admin-panel-users-roles#create_table_calculations) to create table calculations, you can use [shortcut calculations](/looker/docs/table-calculations#quick_calculations), which let you perform common calculations on numeric fields that are in an Explore's data table without the need to use Looker [functions and operators](/looker/docs/functions-and-operators).\n\u003e You can also apply table calculations directly to the values in the **Total** row.\n\nWhy calculations in the Total row may be confusing\n--------------------------------------------------\n\n\nThe examples and discussions on this page are based on an example of an Explore query: **Order Items Count** , **Users Count** , **Order Items per User** , and **Mean Order Items** grouped by **Orders Created Date** with the [**Totals**](/looker/docs/creating-and-editing-explores#displaying_totals) option applied:\n\n\nThe total for the **Order Items per User** is 4.5, which is the expected rounded total of 54,767 (**Order Items Total** ) divided by 12,290 (**Users Count Total**).\n\n\nThe total for the **Mean Order Items** is 54,767, which is the total **Order Items Count** --- 54,767 --- divided by 1, which may not make sense to display to users.\n\n\nAs discussed in the\n[Considerations for using table calculations](/looker/docs/table-calculations#considerations_when_using_table_calculations) section of the [Using table calculations](/looker/docs/table-calculations) documentation page, table calculations calculate totals based on the single **Total** row, not on the values in the data column. The results are clearly understandable for some calculations, like\nthe **Order Items per User** table calculation total.\n\n\nHowever, table calculations that perform aggregations --- for example, calculations\nthat use `percentile` and `median` --- may calculate totals in confusing ways, such as in the **Mean\nOrder Items** total in the example of the Explore.\n\nReplacing a calculation total with a null symbol in the Total row\n-----------------------------------------------------------------\n\n\nIf you have a potentially confusing result in a table calculation total, you\ncan replace one of your totals with a null symbol using the following table calculation expression. You can replace `my_grouping_dim` with your grouping dimension, and `table_calc` with the table calculation for which you wish to display a null in the **Total** row: \n\n```\nif(is_null(my_grouping_dim), null, \u003ctable_calc\u003e)\n```\n\n\nIf the previous expression is applied to the **Mean Order Items** table calculation, the table calculation will display a null symbol for the **Mean Order Items** total in the data table **Total** row: \n\n```\n if(is_null(${orders.created_date}), null, mean(${order_items.count}))\n```\n\n\nThis result looks like the following in the data table:\n\n\nAdditional resources\n--------------------\n\n\nFor additional information regarding troubleshooting totals for measures, see the\n[Why don't my totals match the values in my table?](/looker/docs/best-practices/how-to-troubleshoot-looker-totals) Best Practices page."]]