I have last problem. When I use API for c/c++/basic and want to extract a content through my new MDX-view from this cube, I upload all content of cube.
For example:
Code: Select all
//cube by name
TM1V hCube = TM1ObjectListHandleByNameGet(hPool, hServer, TM1ServerCubes() , TM1ValString(hPool, "}ClientGroups" , 0));
//view by name
TM1V hView = TM1ObjectListHandleByNameGet(hPool, hCube , TM1ValIndex(hPool, 357), TM1ValString(hPool, "mdx_View_last9", 0));
//extract data from view
TM1V hExtractList = TM1ViewExtractCreate(hPool, hView);
TM1V hExtract = nullptr;
while (nullptr != (hExtract = TM1ViewExtractGetNext(hPool, hExtractList))) {
if (TM1ValType(hUser, hExtract) == TM1ValTypeError())
std::cerr << "Oops\n";
TM1_INDEX ind = TM1ValType(hUser, hExtract);
if (ind == TM1ValTypeIndex()) {
TM1_INDEX n = TM1ValIndexGet(hUser, hExtract);
if (n > 0)
std::cout << n << std::endl;
else
break;
}else if (ind == TM1ValTypeString())
std::cout << TM1ValStringGet(hUser, hExtract) << std::endl;
else if (ind == TM1ValTypeReal())
std::cout << TM1ValRealGet(hUser, hExtract) << std::endl;
else
std::cerr << "Oops 2\n";
}
Code: Select all
https://as-msk-a0134:8000/api/v1/Cubes('}ClientGroups')/Views('mdx_View_last9')/tm1.Execute?$expand=Cube($select=Name;$expand=Dimensions($select=Name)),Axes($expand=Tuples($expand=Members($select=Name;$expand=Element($select=UniqueName)))),Cells
How can I extract data through mdx-view correctly using API c/++/basic?