{"id":2549,"date":"2024-01-08T15:08:15","date_gmt":"2024-01-08T13:08:15","guid":{"rendered":"https:\/\/bitimpulse.com\/?post_type=manual&#038;p=2549"},"modified":"2024-01-08T15:10:15","modified_gmt":"2024-01-08T13:10:15","slug":"parametr-korystuvacha","status":"publish","type":"manual","link":"https:\/\/bitimpulse.com\/en\/manual\/rozdacha-prav-dostupu-do-chleniv-vymiru-velykij-kilkosti-korystuvachiv\/parametr-korystuvacha\/","title":{"rendered":"User Parameter"},"content":{"rendered":"<p>On the tab \u201cUser Parameters\u201d you will see the empty list. Let&#8217;s add the parameter \u201cCountry\u201d:<\/p>\n<p><a href=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2550\" src=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_4.png\" alt=\"\" width=\"415\" height=\"241\" srcset=\"https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_4.png 415w, https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_4-300x174.png 300w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2551\" src=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_5.png\" alt=\"\" width=\"386\" height=\"293\" srcset=\"https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_5.png 386w, https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_5-300x228.png 300w\" sizes=\"auto, (max-width: 386px) 100vw, 386px\" \/><\/a><\/p>\n<p>In the field SQL you should set the query which returns two fields: a key and a name. This query should return all possible parameter values. In most cases you will build a query which returns a key and a name of any level of the dimension or attribute. In our case to get the list of all countries we\u2019ll need the following query:<\/p>\n<p>&nbsp;<\/p>\n<p>select distinct EnglishCountryRegionName, EnglishCountryRegionName<\/p>\n<p>from AdventureWorksDW2008.dbo.DimGeography<\/p>\n<p>&nbsp;<\/p>\n<p>Pay attention to the fact that if you are using \u201cAdventure Works 2005\u201d database instead of 2008 version, then in your query you\u2019ll have to change the database name from \u201cAdventureWorksDW2008\u201d to \u201cAdventureWorksDW\u201d.<\/p>\n<p>Press the \u201cExecute\u201d button to see the results of the query execution.<\/p>\n<p>In case you\u2019ll get the message, saying that the SQL Server user, under which the application server establishes connection to the repository DB, has no access to the database from which the data is selected (\u201cAdventureWorksDW\u201d) \u2013 give the appropriate (\u201cdata reader\u201d) access to the user on the \u201cAdventureWorksDW\u201d database. After that press the \u201cExecute\u201d button once again.<\/p>\n<p>After executing the query successfully you will get the window with a result:<\/p>\n<p><a href=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2552\" src=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_6.png\" alt=\"\" width=\"602\" height=\"405\" srcset=\"https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_6.png 602w, https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_6-450x303.png 450w, https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_6-300x202.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p>We see the list of possible values of the parameter. Press the button \u00abClose\u00bb, then \u00abSave\u00bb. The parameter appeared in the list:<\/p>\n<p><a href=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2553\" src=\"http:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_7.png\" alt=\"\" width=\"863\" height=\"667\" srcset=\"https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_7.png 863w, https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_7-450x348.png 450w, https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_7-300x232.png 300w, https:\/\/bitimpulse.com\/wp-content\/uploads\/2024\/01\/16_7-768x594.png 768w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/a><\/p>\n<p><strong>Attention.<\/strong> If the database where you run the query and the repository DB are on different servers, you should create a linked server on the SQL Server where the repository DB is and use the query like this:<\/p>\n<p>select \u2026 from [LinkedServer].AdventureWorksDW2008.dbo.DimGeography<\/p>","protected":false},"featured_media":0,"parent":2543,"menu_order":52,"template":"","manuals":[16],"class_list":["post-2549","manual","type-manual","status-publish","hentry","manuals-bat-admin"],"_links":{"self":[{"href":"https:\/\/bitimpulse.com\/en\/wp-json\/wp\/v2\/manual\/2549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitimpulse.com\/en\/wp-json\/wp\/v2\/manual"}],"about":[{"href":"https:\/\/bitimpulse.com\/en\/wp-json\/wp\/v2\/types\/manual"}],"up":[{"embeddable":true,"href":"https:\/\/bitimpulse.com\/en\/wp-json\/wp\/v2\/manual\/2543"}],"wp:attachment":[{"href":"https:\/\/bitimpulse.com\/en\/wp-json\/wp\/v2\/media?parent=2549"}],"wp:term":[{"taxonomy":"manuals","embeddable":true,"href":"https:\/\/bitimpulse.com\/en\/wp-json\/wp\/v2\/manuals?post=2549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}