# View: ph_audit_ph_usage_fact_sales

**View Name:** ph_audit_ph_usage_fact_sales
**Table Source:** `Derived from: Prod.Dim_Country, Prod.Dim_Label, Prod.Dim_Release, Prod.Workstation_Fact_Sales_Unified_Dbt, Royalty_Accounting + 1 more`
**File Path:** `ph_audit_ph_usage_fact_sales.view.lkml`

## Overview

- **File Size:** 15588 bytes
- **Lines of Code:** 60
- **Dimensions:** 6
- **Measures:** 1
- **Dimension Groups:** 0
- **Filters:** 0

## Dimensions

| Name | Type |
|------|------|
| `labelid` | string |
| `labelname` | string |
| `activityyear` | string |
| `releaseid` | string |
| `country_code` | string |
| `sumfs_gross` | number |

## Measures

| Name | Type |
|------|------|
| `count` | count |

## Derived Table

```sql
sql: select  fs.labelid, l.labelname,  fs.activityyear, fs.releaseid, c.country_code, sum(fs.gross)
      from royalty_accounting.prod.workstation_fact_sales_unified_dbt fs
      inner join facts.prod.dim_country c on c.countryid=fs.countryid
      inner join facts.prod.dim_release r on r.releaseid=fs.releaseid
      inner join facts.prod.dim_label l on l.labelid=fs.labelid
      where  fs.storeid=286 and fs.activityyear in (2019, 2020)
      and l.labelid in (28932,11933,29332,28943,29138,28925,28976,29092,29032,29713,30328,29972,28999,29406,28940,28936,29401,29881,29864,28945,30514,29182,30005,29012,29494,29652,29292,29403,29625,29512,29116,29077,29463,28958,28854,28960,29815,28955,30054,29927,29460,29823,28935,29632,29194,29851,29438,29499,29223,29577,30151,29219,29229,29611,29171,29693,30082,28969,29502,29106,29640,29409,29561,29666,28994,28953,29397,29227,29662,29251,29239,29449,29426,29609,29102,29275,29246,29184,28964,29224,30056,29244,29046,29169,30003,28937,29872,29359,29063,29861,30105,29249,29886,29356,29954,29867,29195,29007,28972,28942,29044,29517,29513,29565,29154,29234,29005,29758,30063,28954,29514,29172,29051,29197,29349,29476,29936,30022,28951,29075,29011,29087,29187,28929,29451,29857,29477,30413,28970,29895,29164,29525,29837,28981,28603,29300,29030,29795,29591,29527,29353,29682,29024,29627,29237,29180,24827,32142,29348,29048,32374,29179,29233,29506,29772,29115,31225,29585,29148,29365,29655,29780,29020,29986,29862,29084,30099,29608,28944,29586,28983,29496,29697,29309,29080,29888,29280,29290,29587,29213,29059,29283,29305,30121,29521,29834,30222,30246,29363,30458,30142,29720,29322,29054,30250,29366,29368,28797,29109,29245,29579,29964,29062,28971,29946,29783,29522,29430,29168,28930,29635,29402,29711,29377,29626,29763,29389,29144,29887,29370,29487,29891,31043,29358,29383,30468,29650,29979,28927,29325,29588,29284,30154,28966,29526,29479,29590,29324,29736,29267,29294,28995,29086,29279,29643,29646,29467,29568,28977,30133,29818,29951,29504,29357,29482,29269,29480,29378,29707,29050,29345,29419,29190,29207,29515,29161,29966,32410,29495,29768,30143,29268,29204,29933,29068,30060,29618,29723,28931,29696,29773,29327,29536,28991,29801,29374,29663,29135,30265,30031,30111,28987,29038,29276,29367,29762,29254,29432,29484,29743,28947,30228,29122,29680,29160,29808,29739,29497,29677,29744,29003,29166,29800,28924,29006,29015,29379,29398,29153,29465,28980,29220,29258,29056,29247,29316,29676,30007,29371,29641,29541,29420,30008,30115,29469,29727,29437,29638,29955,28965,29009,29664,29307,29730,29386,30187,29272,29876,29394,29706,29395,29218,29530,29483,29846,29177,28933,29031,29336,31412,29372,29232,29835,29566,29427,29170,29088,29120,29343,29288,29450,30037,29724,30087,29578,28934,30084,29259,29094,29941,30038,29651,29690,29957,29417,29099,29119,29340,29910,30467,29373,29719,29894,29396,29354,30196,29610,30393,29573,30076,30167,29264,29616,30188,30329,29794,29163,29142,29145,29918,30051,29505,32143,29091,32133,30169,29548,29896,29285,29751,29311,29250,30164,30176,29969,29873,29392,29221,29464,29750,29222,29140,30078,30460,29557,29938,29355,29158,29695,30146,29123,29136,29493,30205,31495,29203,30153,29715,29943,29600,28928,29550,29320,29975,29240,29992,29098,29703,29100,29209,30077,29831,29111,29301,29595,30361,29296,29709,29511,28949,29670,30006,29157,29923,29085,29021,28993,28952,29997,30101,29892,29411,29847,29278,29545,29001,29312,29458,28938,29612,30102,29125,30272,29543,29000,29589,29906,29029,29893,29423,29705,29984,29769,29037,29462,29623,29999,28989,29782,28974,29658,30366,29688,29868,29580,32559,29665,29974,30171,30377,29740,29915,29103,29628,29771,29939,29820,29875,29914,29582,29174,29877,29633,29742,29539,32689,29726,29291,29212,30262,29701,30200,29341,29081,32141,29524,29537,29556,29155,29318,29950,30039,30390,29434,29231,30453,30313,30372,29013,30462,29214,29659,30024,31443,29976,29439,29041,30252,29303,30112,29429,29058,30249,29731,29017,31231,29393,29181,29199,29475,30026,29716,30074,31528,30218,30119,29710,29433,29381,29492,29667,30219,30203,29535,29838,29387,30445,29702,30242,30212,29457,29759,29528,31576,29289,30086,29185,29516,29804,29265,29257,29043,29948,29564,29134,30134,29042,29672,29678,29408,29949,29747,29841,29757,29404,29248,29053,29162,29107,29825,29866,28948,30125,29621,29786,29178,29293,30236,30314,29944,29156,32705,30299,29766,29648,30090,29071,30266,32375,29560,29836,29057,29884,29202,29722,29442,29843,29008,29045,29687,29070,29503,28997,28963,31221,29440,29486,29253,29540,29917,29230,29789,30883,29441,30040,29082,29660,28946,29481,29121,29647,30370,30368,29733,30094,29880,29806,29083,29694,29186,30518,29991,28962,29830,30258,30173,30247,29298,30296,29266,30221,29004,29749,30000,30295,29671,29934,29935,31167,29817,29260,29089,29574,30352,29575,30018,29388,30088,29684,30034,29554,30947,30013,29781,29446,29262,29485,29544,29347,29552,30129,29850,29828,30122,29996,31279,29375,29770,29335,30201,30012,31185,29563,30359,29342,30158,29523,29630,29508,29351,29796,30825,29549,29376,29947,29532,30226,29558,29555,30283,31220,28982,29035,30335,31407,31042,30337,30028,29613,29110,31188,30934,29040,29126,30455,30191,29271,29425,29685,31390,30309,30884,30108,30065,29333,29639,29767,30983,30338,29334,29431,29673,29256,29904,30172,31393,29489,30952,29965,31522,29039,30797,29624,29649,29238,30049,29113,30162,29775,30389,29748,30267,29026,29306,29188,29350,29737,29809,29095,30223,29728,29675,30276,31321,31168,31254,29165,30325,29416,30010,29159,29567,29338,29909,31040,29128,30019,29060,29840,29821,30025,29319,29211,29732,29816,29597,29902,29390,29802,30174,29124,30323,30095,31496,29061,30334,30185,31350,29645,29216,29455,29669,29014,30846,30148,28967,29236,30107,29297,30873,30150,29313,30713,30075,30085,31326,29096,29689,29369,28986,29317,29391,29899,29468,30004,29049,30083,29252,30416,29143,32041,30059,29985,29785,30969,29413,31207,30198,30346,30273,29922,30170,29418,29571,30388,30708,29173,31387,31444,31427,30036,29784,31433,30152,29849,29453,29282,31384,29832,29131,30291,29189,29995,30214,29551,29542,29364,29982,29206,29132,30938,31192,29152,30261,29761,30972,29217,30826,29870,29196,31519,29779,30659,29858,29328,31341,30123,29704,30415,30647,29903,31329,31434,30448,31202,29286,31283,30339,30256,29422,31619,29274,30300,30227,31420,30321,29741,31354,30899,30194,29101,29117,29797,29908,30136,30014,30410,29421,30206,29674,29149,29073,30909,29813,29490,30155,30384,29228,30057,29760,31344,29699,29839,29683,31422,30052,29076,29339,29572,30319,29686,30023,29424,30732,29958,29150,32037,29183,29594,29606,29937,29869,28973,29930,29192,29533,30331,29889,31361,29971,29090,30399,30915,29746,29619,30244,29911,30067,30996,30417,30636,29176,30225,30332,29814,30986,30186,29444,29824,31699,29491,28978,29788,30041,29700,29848,30079,30463,30144,30951,29559,29953,29507,29637,29104,29569,30061,29791,29146,29314,30948,31550,29052,29534,29973,29977,30147,30391,29792,29198,30050,30209,29622,30940,29854,31538,28975,29255,30207,29581,29860,31632,30243,30367,29990,29384,29235,29452,30454,30058,30069,30903,29547,31278,29415,29735,31452,30977,31303,29657,29010,29277,31003,29538,30213,29756,31174,29790,30787,29654,31235,30881,30275,29456,28988,29114,29599,30234,30116,29193,30392,30104,31164,30757,29583,31405,30229,31811,32842,29473,30190,30409,29833,29067,30705,29385,30131,29634,29603,29879,30418,29605,31430,29729,30288,30843,30784,30440,30766,29129,29108,31459,30301,29518,31418,28979,30096,32888,30009,31204,29326,31149,30444,31027,29920,29601,30193,29055,31263,29916,29855,29807,29620,30092,29175,30279,32023,29993,29859,30032,30385,31172,30979,29931,30885,29698,29799,29584,29500,29656,31650,31260,31447,30204,31482,29983,29681,29352,30251,29614,31364,28926,29631,30231,30768,30910,30442,31637,29147,29242,29962,30420,30411,28990,30145,30210,29988,29191,29436,30269,31205,31404,30720,29913,30289,30016,29478,30387,30011,29907,29466,29926,31214,30405,30668,29529,30703,31152,30179,29501,30302,31228,29928,29921,31030,28957,29065,29210,31501,30020,29856,29295,29752,29151,31291,31013,30870,30824,31126,31162,29033,30957,31151,30189,30432,29299,31583,30235,30435,29471,29127,30836,31403,29036,30215,30976,31548,29754,31289,30043,29882,31606,30429,29708,30257,29380,29803,30740,29137,31360,29871,31300,31640,29718,30347,29883,30908,31370,29018,29890,30728,29642,29981,29022,30053,29243,30783,31165,31215,29546,31183,31634,31493,29454,30738,31298,30612,29764,29805,30021,30178,31490,31438,30280,30062,28961,31659,30281,31603,30439,29998,30047,31730,29989,31340,31232,31251,29691,30149,29863,30625,30168,31524,30913,30318,30017,30180,30853,30072,32065,31669,30064,31639,29074,31015,30674,31783,31131,31483,31007,29905,31179,30371,31234,31446,29428,30046,30015,31985,31464,29967,29952,31523,31470,31336,30449,31577,31293,30489,29519,30750,29112,31664,32034,31419,31474,30197,30373,30175,30606,29900,30239,31317,30994,31296,31565,31046,31453,30465,31990,30093,30966,31144,30795,30786,32003,30114,31557,30297,30676,31023,31158,31002,31178,31514,29653,30877,30654,33036,30805,30822,31343,31227,29531,30106,30199,31497,31429,30113,29753,30070,30452,30141,29745,31996,30307,29960,29636,30753,30967,30001,31417,31349,32139,31662,31333,29844,29263,31610,30124,30767,28941,30431,29970,30326,31600,31195,30987,30402,29845,31517,30120,29215,31173,29827,31306,30068,31695,30730,30945,30424,30157,31441,31674,31801,30838,30985,30904,30089,29842,30033,31431,31277,30639,31513,30813,31820,29980,30195,31166,30404,32002,31687,30426,29865,30975,30071,29661,31569,29929,30396,29810,31322,31196,31238,30928,29961,30776,29270,31369,29139,30466,31416,30827,31627,30277,31342,31012,30403,29725,30954,29615,30682,30425,31827,30744,32012,31826,31673,29978,30117,30739,31316,31479,31294,29787,30365,29064,31449,30446,30002,31651,30177,31282,31530,31838,30098,29924,31382,30278,29019,31130,31579,30711,29778,30073,31954,29798,30320,31206,30950,30660,30745,31373,31181,31358,29959,30709,31332,31311,30835,31629,31249,31535,31572,28985,30869,31734,31526,29602,31146,31546,31347,30982,31320,31821,31274,30091,31376,30130,30183,30875,31727,31891,31353,30245,29714,31508,30395,31999,31468,30437,31028,29414,31492,29069,30973,32949,30764,31139,30868,30263,31471,31737,31310,30809,30163,29968,32042,31138,29811,31653,30900,30427,29346,32040,32293,30624,30419,30400,30357,30894,31014,31466,30428,30379,30340,30888,31771,30285,31649,30355,30756,32948,31613,32798,31717,29141,31612,31488,30995,30233,30259,29362,31593,31520,30160,31375,31621,30880,29337,30350,30644,30774
                        ,30240,29765,29200,31136,30230,31147,29987,31692,30933,31045,30208,31799,30857,31638,31016,29273,30712,31217,30232,31564,29027,30689,30752,30686,31933,30364,31297,30992,30202,31327,30716,31394,31486,31334,30255,31744,31675,30386,31047,31359,30663,30743,30398,31628,31247,30433,30961,31726,30382,31383,31127,30443,30887,29644,31159,31598,30336,31626,31335,32036,30354,30731,31558,29852,29919,30889,30292,30241,30159,30956,30282,31395,30220,30362,31614,31175,29774,31469,31194,31380,28996,30456,31305,30818,30789,30829,29078,30815,30127,30733,30707,31374,31200,31570,31518,31388,31755,30290,31571,29994,31265,31257,31211,31153,31685,31472,30376,30363,31029,31665,30161,31041,30029,30217,31980,30224,31039,30401,31423,32001,31351,31533,30794,30044,30893,30641,30726,31749,30408,31800,31212,30118,30434,30349,31193,31894,32039,30342,31722,31280,31432,31299,31218,30343,31542,31362,30882,30333,31529,31455,31616,31559,31636,29323,31504,30981,31671,31652,29604,31836,31377,30447,31478,30407,30184,30788,31536,30941,30968,32391,31409,31716,31406,30312,30865,29570,32031,31491,31880,30718,31489,31814,31870,31807,31580,30284,31345,31760,31740,30942,30412,31947,31758,30823,31729,31839,31396,30436,30907,31457,31148,30341,31547,31617,31718,31595,31391,30248,31421,31848,31711,30293,30459,31657,30856,31323,31750,30808,31694,31187,31666,31229,31754,31910,30100,30315,31574,31437,31884,31022,31793,30274,30030,30450,31150,30097,31778,30308,30322,29201,30861,31770,30775,31724,31171,31292,31128,29331,30294,30970,31766,31845,29225,31654,31962,30271,30192,31051,30633,30626,31346,30896,30351,31463,31926,31246,31892,31822,29287,31959,30833,30911,31170,30943,31828,31682,31328,30345,30706,30358,31511,31715,31599,31000,31824,30360,30110,30369,31763,31976,30627,31785,31436,30923,32006,31551,30238,31025,32019,31539,31895,31913,30832,31841,31567,31782,31156,31805,31796,31975,31939,31267,32026,30380,31676,31052,30859,31816,31813,31544,31586,30356,30820,31451,31498,30872,31809,30156,31886,30344,29435,31765,31578,31934,31856,30675,29822,31313,31680,30330,31325,31854,31026,31295,31505,31808,30747,30438,31169,30921,31378,31794,31589,31540,31245,31594,30378,32045,31775,30690,30135,30139,30260,31982,31615,31658,31435,30791,30165,30762,30423,31018,31994,31499,30311,31949,31366,31642,30348,30681,30736,31786,30109,31792,31426,31991,31787,31865,31661,30965,31521,31752,31915,31971,31461,30971,32035,31921,30692,30998,30394,32032,30451,31768,31255,30287,31900,31414,31704,31233,31442,31596,31411,31842,30422,30724,30695,30406,30421,31844,31764,31881,31986,31810,30353,30837,30310,31475,30414,30702,31648,31912,31620,31502,31386,31487,31937,30646,32261,31769,31655,30912,32027,31919,32011,30658,31428,30270,31901,30935,31160,31597,31920,30327,31929,32018,31875,30457,32015,31608,30897,31995,30461,31873,31979,31506,31852,31833,31582,31882,30381,31725,30383,31898,31850,30980,31142,31851,32021,31791,32409,30375,31871,32004,30298,31044,31545,31803,30441,31667,31681,32038,31210,31731,29105,30664,31759,31885,31817,31477,31897,31862,31553,32010,31672,31864,31357,31952,31753,31736,31969,28956,30725,31872,32013,31480,31948,30464,31689,31779,31683,31942,31998,30989,31053,31607,31678,31058,32715,31566,31908,31735,31248,31941,31918,30735,31645,30840,31618,32000,31795,31889,31944,31751,31774,31541,31984,31830,31960,31936,31684,30618,32030,31485,30801,31978,31688,31590,31741,31773,31009,31957,30613,31720,31633,30303,31748,29448,31911,31993,31575,31859,32167,30620,31863,31906,31059,30642,31677,31902,31728,31584,31622,32717,31825,31835,31797,31950,31679,31874,31208,30643,31974,31064,32024,31987,30850,30672,31878,31503,30324,31784,31905,31456,31968,31843,30680,32005,31761,31907,31563,31402,31243,31527,31742,31923,31989,31868,31855,31781,31860,31587,31972,31693,31776,30821,31927,31832,31964,32046,31963,31733,32056,32009,31903,31965,31834,31668,31415,31917,31914,31869,31819,31812,31484,31035,31831,31888,31932,31746,31757,31867,31945,31983,31512,31866,31706,31180,31271,31857,31439,30649,30628,31705,31928,31935,31762,31500,32022,31925,31745,31806,31556,31961,30922,31701,31623,31931,30839,32029,31719,31721,31992,30890,31777,32020,31966,32025,29066,30974,31356,31973,31924,30665,31883,31955,31953,28992,31462,31573,31738,29167,31696,31473,30959,30891,31938,33508,33341,33392,33241,33425,33492,32947,33176,33185,33336)
      group by 1,2,3,4,5
       ;;
```

