需要使用公式进行排序或分组的帮助

时间:2019-03-26 04:39:24

标签: sorting crystal-reports formula

以下公式用于确定合规性。我需要对不适用的结果进行排序。不,是的有什么建议么?我没有选择使用此公式排序或分组的选项。 下面是主要公式。患者类型公式如下

IF {Command.BATH_STATUS}='NOT DOCUMENTED' THEN 'NO' else IF {@PATIENT
TYPE}='STANDARD' AND {Command.BATH_STATUS}='WASHED / GIVEN'  AND
ISNULL({Command.STANDARD_BATH})THEN 'NO' ELSE IF
{Command.BATH_STATUS}='Refused' THEN 'N/A' ELSE IF
{Command.MEAS_VALUE} LIKE '*Refuse*' THEN 'N/A' ELSE IF
{Command.MEAS_VALUE} LIKE '*Contrain*' THEN 'N/A' ELSE IF
{Command.BATH_STATUS}='NOT DOCUMENTED' THEN 'NO' ELSE IF
{Command.BATH_STATUS}='NOT GIVEN' THEN 'NO' ELSE IF
{Command.MEAS_VALUE} LIKE '*Incontinence care*' THEN 'NO' ELSE IF
{Command.MEAS_VALUE} LIKE '*Independent*' THEN 'YES' ELSE IF
{Command.MEAS_VALUE} = 'NOT GIVEN' THEN 'NO' ELSE IF{@PATIENT
TYPE}='STANDARD' AND {Command.BATH_STATUS}='WASHED / GIVEN'  AND
{Command.STANDARD_BATH} ='Standard bathing wipes' THEN 'YES' ELSE
IF{@PATIENT TYPE}='STANDARD' AND {Command.BATH_STATUS}='WASHED /
GIVEN' AND NOT ISNULL({Command.STANDARD_BATH})THEN 'YES' ELSE
IF{@PATIENT TYPE}='STANDARD' AND {Command.BATH_STATUS}='WASHED /
GIVEN' AND NOT ISNULL({Command.STANDARD_BATH})  AND NOT
ISNULL({Command.CHG})THEN 'YES' ELSE IF{@PATIENT TYPE}='STANDARD' AND
{Command.BATH_STATUS}='WASHED / GIVEN' AND NOT
ISNULL({Command.STANDARD_BATH})  AND ISNULL({Command.CHG})THEN 'YES'
ELSE IF{@PATIENT TYPE}='CHG' AND {Command.BATH_STATUS}='WASHED /
GIVEN' AND NOT ISNULL({Command.STANDARD_BATH})  AND NOT
ISNULL({Command.CHG})THEN 'YES' ELSE IF{@PATIENT TYPE}='CHG' AND
{Command.BATH_STATUS}='WASHED / GIVEN' AND NOT
ISNULL({Command.CHG})THEN 'YES' ELSE IF{@PATIENT TYPE}='STANDARD' AND
{Command.BATH_STATUS}='WASHED / GIVEN' AND
ISNULL({Command.STANDARD_BATH}) THEN 'NO' ELSE IF{@PATIENT
TYPE}='CHG' AND {Command.BATH_STATUS}='WASHED / GIVEN' AND
{Command.STANDARD_BATH} ='Standard bathing wipes'  AND
ISNULL({Command.CHG}) THEN 'NO' ELSE IF{@PATIENT TYPE}='STANDARD' AND
{Command.BATH_STATUS}='WASHED / GIVEN' AND
ISNULL({Command.STANDARD_BATH}) THEN 'NO'

患者类型公式为

IF {Command.DEPARTMENT_ID} IN [2133009,4313023,4313015,4313016,4314007,4314009,4314027,5119219,5119221,5115578,73,5115579,5119222,5123216,
5133207,5119223,5101202,5133026,5119220,5120202,5119218,5119235] THEN 'CHG'
ELSE
IF NOT ISNULL({Command.IP_LDA_ID_A}) THEN Minimum 
({Command.CL_PATIENT_TYPE_A}, {Command.Y_MRN})
ELSE
{Command.RM_PATIENT_TYPE}

我尝试使用

if {@compliance} = 'n/a' then 1 
  else 
if {@compliance} = 'no' then 2 
  else 
if {@compliance} = 'yes' then 3 

我还是不能使用它。

1 个答案:

答案 0 :(得分:0)

不确定问题是什么,但是如果您尝试基于公式的结果进行分组,则可以按以下步骤进行操作:

插入>分组>从下拉菜单中选择公式,并按预期顺序进行排序。