2017-08-15 110 views
1

我希望你能提供幫助。我面臨的問題是這樣的。 我在我的數據中有一列叫做'客戶子類型' 在本專欄中,我對同一事物有許多值。因此,牙醫,藥劑師,醫生,營養師等都屬於同一事物HCP(醫療保健專業人員) 我想要做的就是將所有我認爲是HCP的價值觀與我認爲是HCO的價值觀區分開來(醫療保健組織)Spotfire Bin或計算列

我試圖BIN我HCP值,你可以在圖一看

而且我已經申請這個HCP合併的列到一個文本區域上我的地圖圖和柱狀圖左側見圖片2

圖1 enter image description here

Pic 2 enter image description here

在圖2中,您可以看到我已經過濾2017年,保加利亞和HCP的,我從圖表中得到了相應的回覆。但其他HCO仍在展示,這不完全是我想要的。 我想要的理想情況是HCP和HCO的複選框是HCP或HCO的數量,就像HCP或HCO的數量在每個複選框下累積了這筆錢數一樣,檢查或檢查,並告訴每個的數量(參見藝術表現圖片4);-),當然地圖也會作出相應的反應。

能裝倉實現這一目標還是應該用什麼計算列像如果「客戶亞型」 =「牙醫」或「醫生」或「藥師」再算上給我看的價值。在這種情況下更合適。

產品圖4 enter image description here

Scsimnon代碼

case when ([Customer Subtype]="Administrator") or (
      [Customer Subtype]="Allied Health Practitioner") or (
[Customer Subtype]="Dental Hygienist/Assistant") or (
[Customer Subtype]="Dentist") or (
[Customer Subtype]="Dietitian") or (
[Customer Subtype]="Educator") or (
[Customer Subtype]="Executive") or (
[Customer Subtype]="General Practitioner") or (
[Customer Subtype]="Health Educator") or (
[Customer Subtype]="Healthcare Business Professional Other") or (
[Customer Subtype]="Healthcare Professional Other") or (
[Customer Subtype]="Healthcare Professional Unknown") or (
[Customer Subtype]="Hospital Pharmacist") or (
[Customer Subtype]="Hospital Physician") or (
[Customer Subtype]="Hospital/Practice Physician") or (
[Customer Subtype]="Journalist") or (
[Customer Subtype]="Lab Technician") or (
[Customer Subtype]="Medical Assistant") or (
[Customer Subtype]="Medical Student") or (
[Customer Subtype]="Microbiologist") or (
[Customer Subtype]="Midwife") or (
[Customer Subtype]="Non-Medical Healthcare Worker") or (
[Customer Subtype]="Nurse") or (
[Customer Subtype]="Nurse Practitioner") or (
[Customer Subtype]="Occupational Therapist") or (
[Customer Subtype]="Office Manager") or (
[Customer Subtype]="Paramedical") or (
[Customer Subtype]="Pharmacist Assistant") or (
[Customer Subtype]="Physical Therapist") or (
[Customer Subtype]="Physician") or (
[Customer Subtype]="Prescribing Nurse") or (
[Customer Subtype]="Researcher") or (
[Customer Subtype]="Resident") or (
[Customer Subtype]="Social Worker") or (
[Customer Subtype]="Specialist Physician") or (
[Customer Subtype]="Veterinarian") or (
[Customer Subtype]="Pharmacist") then "HCP's" 

when ([Customer Subtype]="Advisory Board/Committee Public Service") or (

[Customer Subtype]="Assoc/Society/Foundtn") or (
[Customer Subtype]="Business/Employers") or (
[Customer Subtype]="Cancer Treatment Center") or (
[Customer Subtype]="Chain Retail Pharmacy") or (
[Customer Subtype]="City Health Department Public Service") or (
[Customer Subtype]="City Hospital Committee Miscellaneous") or (
[Customer Subtype]="City Hospital Department") or (
[Customer Subtype]="City University/College Miscellaneous") or (
[Customer Subtype]="City/County Health Authorities Public Service") or (
[Customer Subtype]="City/County Primary Care Health Authority Public Service") or (
[Customer Subtype]="City/County Secondary Care Health Authority Public Service") or (
[Customer Subtype]="County Assoc/Society/Foundtn Miscellaneous") or (
[Customer Subtype]="County Health Department Public Service") or (
[Customer Subtype]="County Healthcare Fclty Contracting Agent") or (
[Customer Subtype]="County Hospital") or (
[Customer Subtype]="County Medical Ofce O/P Medical Fclty") or (
[Customer Subtype]="County Miscellaneous") or (
[Customer Subtype]="Diagnostic Center ") or (
[Customer Subtype]="Disease Management Team") or (
[Customer Subtype]="Distributor") or (
[Customer Subtype]="Dual/Oth Gov Agcy Hospital") or (
[Customer Subtype]="Dual/Oth Gov Agcy Miscellaneous") or (
[Customer Subtype]="Family Planning Clinic") or (
[Customer Subtype]="Federal/Country Assoc/Society/Foundtn Miscellaneous") or (
[Customer Subtype]="Federal/Country Employer Health Plan Business") or (
[Customer Subtype]="Federal/Country Govt Ministry Miscellaneous") or (
[Customer Subtype]="Federal/Country Health Department Public Service") or (
[Customer Subtype]="Federal/Country Hospital") or (
[Customer Subtype]="Federal/Country Hospital Department") or (
[Customer Subtype]="Formulary Committee") or (
[Customer Subtype]="General Hospital") or (
[Customer Subtype]="Formulary Committee") or (
[Customer Subtype]="Health Authorities Public Service") or (
[Customer Subtype]="Health Network") or (
[Customer Subtype]="Health Network System Manage Care Org") or (
[Customer Subtype]="Hospital") or (
[Customer Subtype]="Hospital Department") or (
[Customer Subtype]="Hospital District Hospital") or (
[Customer Subtype]="Hospital District Physician Medical Practice O/P Medical Fclty") or (
[Customer Subtype]="Hospital I/P Pharmacy") or (
[Customer Subtype]="Insurance Managed Care Org") or (
[Customer Subtype]="Long Term Care") or (
[Customer Subtype]="Long-Term Care Provider") or (
[Customer Subtype]="Managed Care Org") or (
[Customer Subtype]="Military Hospital") or (
[Customer Subtype]="Miscellaneous") or (
[Customer Subtype]="Multi-Disciplinary Health") or (
[Customer Subtype]="Non-Instit Hlth Care Svc") or (
[Customer Subtype]="Non-Profit Assoc/Society/Foundtn Miscellaneous") or (
[Customer Subtype]="Non-Profit Charitable Org/Church Miscellaneous") or (
[Customer Subtype]="Non-Profit Indepndnt Physician Assoc Business") or (
[Customer Subtype]="Non-Profit Patient Advocacy Miscellaneous") or (
[Customer Subtype]="Nursing/Rest Home Long-Term Care") or (
[Customer Subtype]="O/P Medical Fclty") or (
[Customer Subtype]="O/P Medical Fclty Department") or (
[Customer Subtype]="Pharmacy") or (
[Customer Subtype]="Pharmacy Department") or (
[Customer Subtype]="Private Ambulatory Surgery Center O/P Medical Fclty") or (
[Customer Subtype]="Private Assoc/Society/Foundtn Miscellaneous") or (
[Customer Subtype]="Private Business") or (
[Customer Subtype]="Private Clinic O/P Medical Fclty") or (
[Customer Subtype]="Private Diagnostic Center Miscellaneous") or (
[Customer Subtype]="Private Hospital") or (
[Customer Subtype]="Private Hospital Intensive Care Unit") or (
[Customer Subtype]="Private Hospital Owned O/P Medical Fclty") or (
[Customer Subtype]="Private Hydrotherapy O/P Medical Fclty") or (
[Customer Subtype]="Private Indepndnt Physician Assoc Business") or (
[Customer Subtype]="Private Media Miscellaneous") or (
[Customer Subtype]="Private Medical Ofce O/P Medical Fclty") or (
[Customer Subtype]="Private Miscellaneous") or (
[Customer Subtype]="Private Nursing/Rest Home Long-Term Care") or (
[Customer Subtype]="Private Patient Advocacy Miscellaneous") or (
[Customer Subtype]="Private Physician Medical Practice O/P Medical Fclty") or (
[Customer Subtype]="Private Third Party Administrator Business") or (
[Customer Subtype]="Private University/College Miscellaneous") or (
[Customer Subtype]="Private Vendor Miscellaneous") or (
[Customer Subtype]="Private Wholesaler Distributor") or (
[Customer Subtype]="Public Ambulatory Surgery Center O/P Medical Fclty") or (
[Customer Subtype]="Public Assoc/Society/Foundtn Miscellaneous") or (
[Customer Subtype]="Public Business") or (
[Customer Subtype]="Public Charitable Org/Church Miscellaneous") or (
[Customer Subtype]="Public Children's & Social Srvcs Public Service") or (
[Customer Subtype]="Public Clinic O/P Medical Fclty") or (
[Customer Subtype]="Public Formulary Committee Miscellaneous") or (
[Customer Subtype]="Public General Hospital") or (
[Customer Subtype]="Public GPO Managed Care Org") or (
[Customer Subtype]="Public Home Health Non-Instit Hlth Care Svc") or (
[Customer Subtype]="Public Hospital") or (
[Customer Subtype]="Public Hospital Department") or (
[Customer Subtype]="Public Hospital I/P Pharmacy") or (
[Customer Subtype]="Public Hospital Owned O/P Medical Fclty") or (
[Customer Subtype]="Public Hospital Special Treatment Fclty/Acute Care") or (
[Customer Subtype]="Public Hospital Special Treatment Fclty/Non-Acute Care") or (
[Customer Subtype]="Public Medical Group Management Business") or (
[Customer Subtype]="Public Medical Ofce O/P Medical Fclty") or (
[Customer Subtype]="Public Medical School Miscellaneous") or (
[Customer Subtype]="Public Mental Health Center O/P Medical Fclty") or (
[Customer Subtype]="Public Miscellaneous") or (
[Customer Subtype]="Public Nursing/Rest Home Long-Term Care") or (
[Customer Subtype]="Public Patient Advocacy Miscellaneous") or (
[Customer Subtype]="Public Physician Medical Practice O/P Medical Fclty") or (
[Customer Subtype]="Public Police/Fire/Ambulance Public Service") or (
[Customer Subtype]="Public Provider Long-Term Care") or (
[Customer Subtype]="Public Retail Pharmacy") or (
[Customer Subtype]="Public Service") or (
[Customer Subtype]="Public University/College Miscellaneous") or (
[Customer Subtype]="Public Vaccine Service Provider O/P Medical Fclty") or (
[Customer Subtype]="Research/Training Hospital") or (
[Customer Subtype]="Specialty Hospital") or (
[Customer Subtype]="State/Region Assoc/Society/Foundtn Miscellaneous") or (
[Customer Subtype]="State/Region Children's & Social Srvcs Public Service") or (
[Customer Subtype]="State/Region Family Planning O/P Medical Fclty") or (
[Customer Subtype]="State/Region Health Authorities Public Service") or (
[Customer Subtype]="State/Region Health Care Management Group Public Service") or (
[Customer Subtype]="State/Region Health Care Management Group Public Service") or (
[Customer Subtype]="State/Region Health Department Public Service") or (
[Customer Subtype]="State/Region Healthcare Fclty Contracting Agent") or (
[Customer Subtype]="State/Region Hospital") or (
[Customer Subtype]="State/Region Hospital Committee Miscellaneous") or (
[Customer Subtype]="State/Region Pharmacy Board Miscellaneous") or (
[Customer Subtype]="University Hospital") or (
[Customer Subtype]="University/College Miscellaneous") or (
[Customer Subtype]="VA Miscellaneous") or (
[Customer Subtype]="Army Hospital") then "HCO's" 
    else [Customer Subtype] 
end as [New Column] 

產品圖5 enter image description here

在HCP和HCO [組織名稱]

飛利浦嘗試

case when [Organization Name]="" then "HCP" 

when [Organization Name]<>"" then "HCO" 


end as [New Column] 

產品圖6 enter image description here

回答

1

根據您在文章中陳述的內容,從長遠來看,計算列肯定會讓您受益。喜歡的東西:

case when [Customer Subtype] = "Dentist" or 
      [Customer Subtype] = "Doctor" or 
      [Customer Subtype] = "Pharmacist" then "HCP" 
    when [Customer Subtype] = "something" or 
      [Customer Subtype] = "something else" then "HCO" 
    else [Customer Subtype] 
end as [New Column] 

但是,如果你是想申請一個複選框過濾器,我要離開了上述ELSE。然後,你的罪名,你只需添加一個Dynamic Item

  • Right CLick on Text Area > Edit Text Area
  • Insert Dynamic Item > Calculated Value
  • 數據選項卡中,選擇適當的數據表
  • 標籤,更改使用以下公式計算值:部分至下列公式

公式:

If([New Column] = "HCP",UniqueCount([Customer Subtype])) 

同樣,對於您的HCO ...

If([New Column] = "HCO",UniqueCount([Customer Subtype])) 
+0

嗨Scsimon。再一次,你來到這個愛爾蘭人的救援:-)謝謝你花時間迴應,總是非常感謝。你給我的代碼在某種程度上工作。我離開了'Else',並且仍然設法生成了Tick Box,在原始文章(我剛剛添加)中看到了Pic 5。我需要的最後一件事就是我不能看出這一點。我已經將我現在在Spotfire模型中使用的代碼添加到原始文章中(我知道它很長),但是您能否告訴我,If([New Column] =「HCP」,UniqueCount([Customer Subtype]))應該去?乾杯 –

+0

不用擔心所有的伴侶。我剛剛添加了一個編輯到我的答案@PhilipConnell – scsimon

+0

嗨Scsimon。再次感謝您的幫助。但我剛剛注意到了一些事情。我的錯誤完全是使用'[Customer Subtype]'是混亂的,因爲可能會有一些新的東西(Onocology Specialist),列表沒有設置。因此,爲了確定HCO和HCP,我寧願使用'[組織名稱]',代碼就像'如果[組織名稱]是空白的,然後HCP,如果[組織名稱]不是空白,那麼HCO'我添加了一些代碼再次在上面,但我似乎無法得到它的工作。我得到一個(空的)參見測試區域的圖片6的值。你能幫忙嗎?對不起, –