tomok wrote: ↑Sat Feb 20, 2021 3:54 pm
NewtoTM1P wrote: ↑Sat Feb 20, 2021 4:06 am
I have a total of 100 cubes and 450 cube views in total,
Many cube views are using some Unnamed subset,
and those elements under Unnamed subsets is similar to other elements under the Named subset.
Therefore, I wonder is there anyways to automatically let the cube view use that Named subset that has the same element under the Unnamed subset.?
Any help will be appreciated. Thanks!
AFAIK, the answer to your question is no. First of all, there is no such thing as an "unnamed subset".
Subsets have to have a name, TM1 will not let you create a subset without a name. I think what you are referring to is the situation where someone created a view and manually filtered some of the dimensions contained in that view and then saved the view. In this case, the elements used in the view are actually saved in the .vue file and are not in a subset, i.e., not in a .sub file somewhere.
I think that's an over-literal definition of what a "subset" is. When you are using MDX you're often working with unnamed subsets, i.e., a list of component elements where the list does not have a name. Even the user interface itself declares the type of subset that you've described as being an "unnamed" subset.

- UnnamedSubset.jpg (50.19 KiB) Viewed 4035 times
tomok wrote: ↑Sat Feb 20, 2021 3:54 pm
There is no way to way to convert the view into using a named subset, instead of the saved elements, except to re-create the view in a TI process
Which means that there
IS a way of doing it, but it depends on the reader's definition of "automatic". It can be automated but no, there is no "one click" button to do it. It is not, however, a way that will be quick and easy and determining the value is in the eye of the beholder.
The information about the unnamed subsets will be in the .vue files, as Tomok said. The structure of those files, and how the subsets are stored, is not excessively complex as you can see from the structure below. The .vue files are simply text files. 7 followed by the dimension name tells you you're about to encounter the subset definition, if the next line is 270 followed by a comma and a number then it's the number of elements in the unnamed subset, followed by a list of the elements.

- UnnamedSubset2.jpg (43.95 KiB) Viewed 4035 times
Reading and parsing that file to extract a list of the elements would not be a huge task if you have access to the database directory, and a decent programming language at your disposal.
If you don't have access to the data directory it could still be done with TI since obviously the server itself has access to its data directory. The problem there is that I said "a decent programming language" whereas TI is the programming language equivalent of a stone axe. Still, it could be done.
Then you would need to compare the extracted list with your named subsets to find a match. Again, easy with a decent language, less easy with a stone axe.
Having done that you could then use either TI or the REST API to redefine the views using the equivalent named subset.
Python may be an option, but if you don't know Python then there's an extra learning curve. If you don't know the REST API, that's another one.
Could you do it entirely in TI? Sure, it would be possible. You'd probably need to create temporary cubes or dimensions to store the extracted element lists, and it would take a LOT of coding (your value of "a lot" may vary), but in theory it's possible. It just depends on how much value the project would have for you.
I've never done something like this myself, and have neither the time nor inclination to do so at this point, but the tools available to you certainly make it possible. (Actually it may well be a fun "exploration" project, so just make that "the time".)
If you have hundreds of views then maybe it's worth your time, especially since once you've done it you can reuse it in the future. However note that this will only work for public views, not private ones. (With private ones the only way I can see it being done is by hacking the .vue text file so that the new view applies the next time the user logs in. While I admit to having done this on occasion in very particular circumstances, altering system files is not something that I can officially recommend.)