0

只想问如何使用视图选择仅基于列值显示前 10 个文档?视图选择的公式在下面的代码片段中。那么视图中有 50 个文档。如何根据 a 列的前 10 个最高值排列它们?

SELECT Form = "MPPP" & MPPPValid != "No" & Status != "Draft" & ProductEndOfLife!= "Product is End of Life" & NonIBMProduct!= "Non IBM Product" & @If(
((

(@If(GDis_0 != ""&L_0!="";L_0;
@If(GDis_1 != ""&L_1!="";L_1;
@If(GDis_2 != ""&L_2!="";L_2;
@If(GDis_3 != ""&L_3!="";L_3;
@If(L_0=""&UL_0!="";UL_0;
@If(L_1=""&UL_1!="";UL_1;
@If(L_2=""&UL_2!="";UL_2;
UL_3))))))))*

(@If(GDis_0 != ""&W_0!="";W_0;
@If(GDis_1 != ""&W_1!="";W_1;
@If(GDis_2 != ""&W_2!="";W_2;
@If(GDis_3 != ""&W_3!="";W_3;
@If(W_0=""&UW_0!="";UW_0;
@If(W_1=""&UW_1!="";UW_1;
@If(W_2=""&UW_2!="";UW_2;
UW_3))))))))*

(@If(GDis_0 != ""&D_0!="";D_0;
@If(GDis_1 != ""&D_1!="";D_1;
@If(GDis_2 != ""&D_2!="";D_2;
@If(GDis_3 != ""&D_3!="";D_3;
@If(D_0=""&UD_0!="";UD_0;
@If(D_1=""&UD_1!="";UD_1;
@If(D_2=""&UD_2!="";UD_2;
UD_3)))))))))/6000000)-

(@If(GDis_0 != ""&PW_0!="";PW_0;
@If(GDis_1 != ""&PW_1!="";PW_1;
@If(GDis_2 != ""&PW_2!="";PW_2;
@If(GDis_3 != ""&PW_3!="";PW_3;
@If(PW_0=""&ULW_0!="";ULW_0;
@If(PW_1=""&ULW_1!="";ULW_1;
@If(PW_2=""&ULW_2!="";ULW_2;ULW_3))))))))>10 |

(((((@If(GDis_0 != ""&L_0!="";L_0;
@If(GDis_1 != ""&L_1!="";L_1;
@If(GDis_2 != ""&L_2!="";L_2;
@If(GDis_3 != ""&L_3!="";L_3;
@If(L_0=""&UL_0!="";UL_0;
@If(L_1=""&UL_1!="";UL_1;
@If(L_2=""&UL_2!="";UL_2;UL_3))))))))*

(@If(GDis_0 != ""&W_0!="";W_0;
@If(GDis_1 != ""&W_1!="";W_1;
@If(GDis_2 != ""&W_2!="";W_2;
@If(GDis_3 != ""&W_3!="";W_3;
@If(W_0=""&UW_0!="";UW_0;
@If(W_1=""&UW_1!="";UW_1;
@If(W_2=""&UW_2!="";UW_2;UW_3))))))))*

(@If(GDis_0 != ""&D_0!="";D_0;
@If(GDis_1 != ""&D_1!="";D_1;
@If(GDis_2 != ""&D_2!="";D_2;
@If(GDis_3 != ""&D_3!="";D_3;
@If(D_0=""&UD_0!="";UD_0;
@If(D_1=""&UD_1!="";UD_1;
@If(D_2=""&UD_2!="";UD_2;UD_3)))))))))/6000000)-

(@If(GDis_0 != ""&PW_0!="";PW_0;
@If(GDis_1 != ""&PW_1!="";PW_1;
@If(GDis_2 != ""&PW_2!="";PW_2;
@If(GDis_3 != ""&PW_3!="";PW_3;
@If(PW_0=""&ULW_0!="";ULW_0;
@If(PW_1=""&ULW_1!="";ULW_1;
@If(PW_2=""&ULW_2!="";ULW_2;ULW_3)))))))))/

(@If(GDis_0 != ""&PW_0!="";PW_0;
@If(GDis_1 != ""&PW_1!="";PW_1;
@If(GDis_2 != ""&PW_2!="";PW_2;
@If(GDis_3 != ""&PW_3!="";PW_3;
@If(PW_0=""&ULW_0!="";ULW_0;
@If(PW_1=""&ULW_1!="";ULW_1;
@If(PW_2=""&ULW_2!="";ULW_2;ULW_3)))))))))>0.2;
@True;@False)

列值的片段:

((((@If(GDis_0 != ""&L_0!="";L_0;@If(GDis_1 != ""&L_1!="";L_1;@If(GDis_2 != ""&L_2!="";L_2;@If(GDis_3 != ""&L_3!="";L_3;@If(L_0=""&UL_0!="";UL_0;@If(L_1=""&UL_1!="";UL_1;@If(L_2=""&UL_2!="";UL_2;UL_3))))))))*(@If(GDis_0 != ""&W_0!="";W_0;@If(GDis_1 != ""&W_1!="";W_1;@If(GDis_2 != ""&W_2!="";W_2;@If(GDis_3 != ""&W_3!="";W_3;@If(W_0=""&UW_0!="";UW_0;@If(W_1=""&UW_1!="";UW_1;@If(W_2=""&UW_2!="";UW_2;UW_3))))))))*(@If(GDis_0 != ""&D_0!="";D_0;@If(GDis_1 != ""&D_1!="";D_1;@If(GDis_2 != ""&D_2!="";D_2;@If(GDis_3 != ""&D_3!="";D_3;@If(D_0=""&UD_0!="";UD_0;@If(D_1=""&UD_1!="";UD_1;@If(D_2=""&UD_2!="";UD_2;UD_3)))))))))/6000000)-(@If(GDis_0 != ""&PW_0!="";PW_0;@If(GDis_1 != ""&PW_1!="";PW_1;@If(GDis_2 != ""&PW_2!="";PW_2;@If(GDis_3 != ""&PW_3!="";PW_3;@If(PW_0=""&ULW_0!="";ULW_0;@If(PW_1=""&ULW_1!="";ULW_1;@If(PW_2=""&ULW_2!="";ULW_2;ULW_3)))))))))/(@If(GDis_0 != ""&PW_0!="";PW_0;@If(GDis_1 != ""&PW_1!="";PW_1;@If(GDis_2 != ""&PW_2!="";PW_2;@If(GDis_3 != ""&PW_3!="";PW_3;@If(PW_0=""&ULW_0!="";ULW_0;@If(PW_1=""&ULW_1!="";ULW_1;@If(PW_2=""&ULW_2!="";ULW_2;ULW_3))))))))

非常感谢帮助。谢谢。

4

1 回答 1

2

仅使用视图选择公式的功能无法以任何合理的方式完成,因为这些公式一次只能处理一个文档。他们根本无法将一份文件与其他文件进行比较并决定“这份文件是否在前 10 名中?” 并非没有帮助。

您可以编写一个针对所有文档运行的代理。每当创建或修改文档时都可以触发它。该代理可以遍历所有文档并使用它需要的任何逻辑对它们进行排序和比较,它可以设置一个特殊的项目TopTen等于@Trueor @False。然后,您需要对选择公式做的所有事情就是将整个内容(SELECT 关键字除外)放在括号内并添加& (TopTen = @True)到末尾。

于 2015-01-29T15:06:29.140 回答