Spotfire Bin或计算列

时间:2017-08-15 14:29:07

标签: charts calculated-columns spotfire binning

我希望你能提供帮助。我面临的问题是这个。 我的数据中有一列名为'客户子类型' 在本专栏中,我对同一件事有很多价值。因此,牙医,药剂师,医生,营养师等都属于同一件事HCP(医疗保健专业人员) 我想做的是将我认为的所有价值观都视为HCP并将其与我认为是HCO(医疗保健组织)的价值观区分开来

我试图将我的HCP值设为BIN,如图1所示

我已将此HCP分箱列应用于我的地图图表左侧的文本区域和条形图参见图2

图1 enter image description here

图2 enter image description here

在图2中,您可以看到我已经过2017年,保加利亚和HCP的过滤,我从图表中得到了相应的回复。但其他HCO仍在展示,这不是我想要的。 我想要的理想情况是,HCP和HCO是一个复选框,其中包含HCP或HCO的数量,以及在每个复选框下方累积了这笔钱的HCP或HCO的数量,以便用户可以取消选中或检查,并告诉每个人的数量,(见艺术表现图4);-)当然,地图将作出相应的反应。

binning可以实现此功能,还是应该使用If 'Customer Subtype' =“Dentist”或“Doctor”或“Pharmacist”之类的计算列进行计数并显示该值。在这种情况下更合适。

图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 个答案:

答案 0 :(得分: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]))