如何在Spotfire中将两行合并为一行?

时间:2018-07-02 17:51:27

标签: spotfire

我被困在Spotfire的某个位置,需要转换表格(下一个)

void columnSelect(vector<string>& ret)
{
    HINSTANCE hInstance = NULL; //NULL = the current process
    WNDCLASSW wc = { 0 };
    MSG  msg;
    wc.lpszClassName = L"Check Box";
    wc.hInstance = hInstance;
    wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
    wc.lpfnWndProc = WndProc;
    wc.hCursor = LoadCursor(0, IDC_ARROW);

    RegisterClassW(&wc);
    CreateWindowW(wc.lpszClassName, L"Check Box",
        WS_OVERLAPPEDWINDOW | WS_VISIBLE,
        150, 150, 230, 150, 0, 0, hInstance, &ret);

    while (GetMessage(&msg, NULL, 0, 0)) {

        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    //return (int)msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
    WPARAM wParam, LPARAM lParam) {

    bool checked = true;

    switch (msg) {

    case WM_CREATE: {
        LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lParam);
        vector<string> *strings = reinterpret_cast<vector<string>*>(lpcs->lpCreateParams);
        for (int i = 0; i != strings->size(); i++)
        {
            CreateWindowA("button", (*strings)[i].c_str(),
                WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
                20, 20, 185, 35, hwnd, (HMENU)1,
                NULL, NULL);
            CheckDlgButton(hwnd, 1, BST_CHECKED);
        }


        break;
    }
    case WM_COMMAND: {
        checked = IsDlgButtonChecked(hwnd, 1);
        if (checked) {

            CheckDlgButton(hwnd, 1, BST_UNCHECKED);
            SetWindowTextW(hwnd, L"");
        }
        else {
            CheckDlgButton(hwnd, 1, BST_CHECKED);
            SetWindowTextW(hwnd, L"Check Box");
        }
        break;
    }
    case WM_DESTROY: {

        PostQuitMessage(0);
        break;
    }
    }
    return DefWindowProcW(hwnd, msg, wParam, lParam);
}

至(此处显示的表格)

ID  First name  last name
1   Mark    
1               Taylor
2   Howard  
2               Giblin

有人可以帮我吗。感谢您的提前帮助!

1 个答案:

答案 0 :(得分:1)

  • 文件>添加数据表
  • 添加(按钮)>从“当前分析”>“您的表名”
  • 在转换下,选择“计算和替换列”>添加(按钮)

然后使用此公式

Max([FirstName]) over ([ID]) as [FirstName]

为您的姓氏重复最后一步

Max([LastName]) over ([ID]) as [LastName]

注意,您也可以在交叉表或计算列中执行此操作。但是,它不会删除重复的行,仅填充空白。