我有一个数据透视表结构如下:
ROWS:
public class MainActivity extends Activity {
ToggleButton togglebutton;
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout rootView = new LinearLayout(this);
rootView.setOrientation(LinearLayout.HORIZONTAL);
rootView.setWeightSum(100);
LinearLayout.LayoutParams par = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT,30);
LinearLayout.LayoutParams part = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT,70);
togglebutton = new ToggleButton(this);
button = new Button(this);
button.setText("Click Me");
button.setLayoutParams(par);
button.setLayoutParams(part);
rootView.addView(button);
rootView.addView(togglebutton);
setContentView(rootView);
}
}
列:
+-State
+---Customer
+-----Brand
我想要另一个列,其中包含每个州的客户数量 。问题在于我的数据包含客户所下的每个订单,因此当我尝试获取客户的数量时,它会返回列中所述客户的每个实例。另一个问题是我的数据是40,000行,所以我想尝试避免编辑原始数据。
我可以用蛮力轻松做到这一点,但我想知道是否还有标准数据透视表和没有附加组件。数据透视表已经很好地整合了客户的唯一值,现在我只需要计算这些唯一值。