Skip to main content

#Export0 utenti parlano di questo argomento

I have the below Microsoft SQL code which basically creates two separate tables (one with index operations and one with ECMOs) and then joins on the ID between them where the date of the the ECMO is after the date of the Index Operation to get a list of hospitalizationIDs that are post-index operation. How do I translate this to Tableau? I started trying to make a custom SQL query but was unsure how to do that and then was thinking a series of calculated fields? Not exactly sure where to start.

 

--create index and ECMO table

select distinct HospitalizationID, IndexOperation, SurgDt

INTO ⌗index

from ⌗export

where IndexOperation=1

group by hospitalizationID, IndexOperation, SurgDt

 

select distinct HospitalizationID, Mechanical_Support, IndexOperation, SurgDt

INTO ⌗ECMO

from ⌗export

where IndexOperation=0 and Mechanical_Support='ECMO'

group by hospitalizationID, Mechanical_Support, IndexOperation, SurgDt

 

--post index operation/surgery ECMO during same hospitalization

select distinct E.HospitalizationID, I.PrimaryPx

from ⌗ECMO E

LEFT JOIN ⌗index I

on I.hospitalizationID=E.HospitalizationID

where E.SurgDt > I.SurgDt 

3 risposte
  1. 4 apr 2023, 08:23

    Hi @Camile Molina​ 

    Some ideas for you.

    Firstly Tableau has the idea of initial SQL: "an initial SQL command that will run when a connection is made to the database, for example, when you open the workbook, refresh an extract, sign in to Tableau Server, or publish to Tableau Server. Initial SQL is not run when your refresh your view." - https://help.tableau.com/current/pro/desktop/en-us/connect_basic_initialsql.htm. Could you use initial SQL to populate some semi-permanent tables? The equivalent of index and ECMO essentially.

    Alternatively perhaps you could use two Custom SQL connections and relate them together? So drop the INTO and use each of those first two queries as a Custom SQL and then relate them on the join.

    Finally could you handle this in data prep / ETL pre Tableau (or maybe even using Tableau Prep), so that when you get to Tableau you just have an index and ECMO table already.

    One other observation - you probably don't need DISTINCT and GROUP BY. The GROUP BY will essentially create the distinct combos.

    Ta,

    Steve.

    PS. Slight caveat to all of the above: you don't specify how the original temp table is created in the queries. That might make a difference to the best approach.

0/9000
Rick Jacobsen ha fatto una domanda in #Data Management

would love to get an overview about all profiles and theire page layouts and export this to excel? I don't think you can do this with dataloader right ?

any suggestions someone?

9 risposte
0/9000

Good day All!

I used dataloader to bulk update object (OLS)/field (FLS) permissions by querying "ObjectPermissions" and "FieldPermissions" data objects from dataloader UI. I did an export, made my edits and then did an import using the same file successfully. 

Now I want to update record type assignment on multiple objects for a particular profile but I am not sure which data object to query on from dataloader UI so I can get the list of Objects with their current record type assignments. Has someone came across this scenario before? Thanks in advance!

-Iftikhar

 

#Export #Object Permissions #Record Types #Dataloader

1 risposta
0/9000

Hi Team,

Does anyone know of a way to get the Account ID and name on an Error export from Dataloader.io? Or even how I could export something without the id's on it?

 

Essentially- I get lists, often, to upload 5 layers deep of order of execution. I'd love a simple solve for this, but in the interim, if I try to upload records that already exist, they come back with an error of "use one of these records instead?" without any added detail.

 

I'd like to minimize the amount of time it takes me to accomplish this.

Any help is greatly appreciated!

Thanks!

-Ashley

 

#Dataloader #Error #Export #Master Detail Relationship

1 risposta
  1. Piyusha Pilania (Implementology) Forum Ambassador
    26 set 2023, 02:46

    Duplicate: https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007KFNyOSAX

     

    If you want to post this in multiple groups just use @ mention to tag all the groups you want to share your question with, you don't need to post multiple times.

0/9000

Can records from a full sandbox be duplicated/transferred to production? #Export

5 risposte
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    20 set 2023, 00:42

    There are a couple of other tools similar to Prodly, but my company has access to Prodly so I use it a lot. Mostly for sandbox seeding rather than sandbox-->Prod. But it definitely has the ability to do that too. You create your dataset and the relationships will come across.

0/9000

お世話になっております。Inspectorを使用して、ページレイアウトの一覧と中身をExcelに出力したいと思っているのですが、ご教授いただけないでしょうか。

 #Export

@* 質問広場~初心者から上級者まで~ 日本 *

4 risposte
  1. 22 mar 2023, 08:30

    @Fuka Satoさん

    こんにちは。

    わたしの場合で恐縮ですが、アドインの「Inspector」でなければならない。という理由が無いようでしたら、以下アドイン利用してのページレイアウトExcelエクスポートも可能です。わたしはこちらを利用しています。

    ※対象オブジェクトのレコード詳細画面を開いた状態で、下記操作行うとエクスポート出来ます。

     

    ーーーー

    ■Salesforce DevTools

    https://chrome.google.com/webstore/detail/salesforce-devtools/ehgmhinnhggigkogkbhnbodhbfjgncjf

    さんこんにちは。わたしの場合で恐縮ですが、アドインの「Inspector」でなければならない。という理由が無いようでしたら、以下アドイン利用してのページレイアウトExcelエクスポートも可能です。わたしはこちらを利用しています。※対象オブジェクトのレコード詳細画面を開いた状態で、下記操作行うとエクスポート出来ます。 ーーーー■Salesforce DevToolsご参考までに。

    ご参考までに。

0/9000
Sandip Sharma ha postato in #Get

How to update / create users coming from Active Directory in Tableau?🙂

 

I have been asked this question many times in last few months in many forums, how to automatically inactive the users in Tableau server if they are getting inactive in Active Directory or how to create Users in Tableau Server in case any users are newly on boarded in AD users groups available in Tableau, hence writing this solution here

 

I will not write full code here, it will give you fair enough idea how to achieve the other things

 

Requirements

  1. Active Directory details
  2. PowerShell
  3. Obdc Driver to reach to Tableau Postgres data base
  4. Make sure Tableau database should be enabled
  5. Administrative privileges on the Tableau server

Script:

 

Clear

⌗Get users from ad server

 

Get-ADUser -Filter * -Properties Name, SamAccountName, EmailAddress, UserPrincipalName, Enabled, Company | Select-Object Name, SamAccountName,UserPrincipalName, EmailAddress, Enabled, Company | where {$_.company -eq "ABHICL"} | Export-Csv "E:\Sandip_SQL\ADUsers_group.csv"

 

⌗export all the users from Tableau Server

⌗importing my tableau server postgres details kept in csv file

$PostgreSQL_Connection_String = import-csv -path "E:\Sandip_SQL\PostgreSQL_Connection_String.csv"

 

foreach ($Row in $PostgreSQL_Connection_String)

{

$connectionString = "Driver=$($Row.Driver);Server=$($Row.Server);Port=$($Row.Port);Database=$($Row.Database);Uid=$($Row.User);Pwd=$($Row.Password);"

}

$connection = New-Object System.Data.Odbc.OdbcConnection

$connection.ConnectionString = $connectionString

$connection.Open()

 

$query = "SELECT name AS UserID,friendly_name AS UserName,licensing_role_name AS Role FROM public._users where name not in ('_system','guest')”

 

$command = $connection.CreateCommand()

$command.CommandText = $query

$command.CommandTimeout = 0 

$result = $command.ExecuteReader()

$table = new-object “System.Data.DataTable”

$table.Load($result)

$table |Export-Csv -path "E:\Sandip_SQL\tableauusers.csv" ⌗ROWS_INSERTED

$connection.Close()

 

⌗importing both files ad users and Tableau users

 

$adusers = import-csv -path "E:\Sandip_SQL\ADUsers_group.csv"

$tabusers = import-csv -path "E:\Sandip_SQL\tableauusers.csv"

 

#I will first check the records only if exist in both csv and then will mark them unlicensed in Tableau server if their status is not active in AD and License type is still allocated to user

⌗matching counter and monitoring of time taken by the script

$matchcounter

$start = [system.datetime]::Now

 

# create new CSV file

foreach ($order1 in $adusers){

  $matched = $false

  foreach ($order2 in $tabusers){

    $obj = "" | select "SamAccountName","Ad_Status","Tableau_Role"

    if(($order1.SamAccountName ) -eq $order2.userid ){

      $matchCounter++

      $matched = $true

      $obj.SamAccountName = $order1.SamAccountName

      $obj.Ad_Status = $order1.Enabled

      $obj.Tableau_Role = $order2.role

      Write-Host "Match Found Orders " "$matchCounter"

      $obj | Export-Csv -Path E:\Sandip_SQL\AD_Tableau_Users_Match.csv -Append -NoTypeInformation

    }

  }

}

$end = [system.datetime]::Now

$resultTime = $end - $start

Write-Host "Execution took : $($resultTime.TotalSeconds) seconds."

 

$updateuser = import-csv -path "E:\Sandip_SQL\AD_Tableau_Users_Match.csv"

 

# Setup to connect

 

$server = "your tableau server url"

 

$s = Invoke-RestMethod -Uri $server/api/3.7/serverinfo -Method get ⌗works on server version 10.1 and later

 

$api = $s.tsResponse.serverInfo.restApiVersion #2020.1 server

 

echo $api

 

⌗make sure you should use either site admin or administrator account only to perform below activity

$username = “your tableau user”

 

$password = “your tableau password”

 

$sitelogin = "" ⌗keep site as blank in case of default site

 

# generate body for sign in

 

$signin_body = (’<tsRequest>

 

 <credentials name=“’ + $username + ’” password=“’+ $password + ’” >

 

  <site contentUrl="'+$sitelogin +'" />

 

 </credentials>

 

</tsRequest>’)

 

$response = Invoke-RestMethod -Uri $server/api/$api/auth/signin -Body $signin_body -Method post

 

# save the auth token, site id and my user id

 

$authToken = $response.tsResponse.credentials.token

 

$siteID = $response.tsResponse.credentials.site.id

 

$myUserID = $response.tsResponse.credentials.user.id

 

$siteURL = $response.tsResponse.credentials.site.contentUrl

 

echo $siteID

 

# set up header fields with auth token

 

$headers = New-Object “System.Collections.Generic.Dictionary[[String],[String]]”

 

# add X-Tableau-Auth header with our auth token

 

$headers.Add(“X-Tableau-Auth”, $authToken)

 

⌗tests whether logged in user is an Administrator (site or server)

 

$loginUserid = Invoke-RestMethod -Uri $server/api/$api/sites/$siteID/users/$myUserID -Headers $headers -Method Get

 

$admin = $loginUserid.tsResponse.user.siteRole -like "*Administrator"

 

if($admin)

{

 

foreach ($line in $updateuser )

 

  {

    if($line.Ad_Status -eq "FALSE" -and $line.Tableau_Role -ne "Unlicensed")

      {

        $userid = $line.SamAccountName

        $SiteRole = "Unlicensed"

                 

        ⌗user update body

        $userupdate = ( '<tsRequest> <user siteRole="'+$SiteRole+'" /> </tsRequest>' )

 

        $response = Invoke-RestMethod -Uri $server/api/$api/sites/$siteID/users/$userid -Headers $headers -Method Put -Body $userupdate

         

        write-host $response.tsResponse.user

 

      }

 

  }

}

 

@Ciara Brennan​  @David Browne​  @Veronica Simoes​ 

3 commenti
  1. 14 set 2020, 15:08

    That's Great @SANDIP SHARMA​ !

0/9000