Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to change with a macro the definition of a dimension, without remove/add a new one.
For example, I have a pivottable dimension (=Dim1). When the user clic on a button, the dimension change and become Dim2.
I don't want to remove/add dimension to keep the properties of the dimension (for example the conditional show).
I can't use variables beacause the user can change the order/number of columns/rows (=change the order of dimensions in the graphe).
I would like to reset the pivottable (reset the order of dimensions = the order/number of columns/rows) with one clic, it means with macro I guess.
Thank you for your help.
Enzo
I find my solution.
I will change the definition of the dimension, the label and the conditional show. I didn't want to delete the dimension to keep the conditional show but I just find a way to replace it.
Moreover, I have a problem with MoveDimension. I don't know why but it doesn't work. I download the last update of QlikView but it doesn't change anything. The solution with MoveDimension was to sort the dimensions thanks to their label ( objProp.Dimensions(j).Title ), but I have to let this down.
Thanks for your help.
What you're looking for is the MoveDimension member. This would move the dimension that's in first position into second position:
set chart=ActiveDocument.GetSheetObject("CH01")
chart.MoveDimension 0,1
Thanks for your answer.
The problem is that I don't know the number of dimension. As I mentioned, the user can change the order of dimensions. For example :
- I have 5 dimension called Dim1, Dim2, Dim3, Dim4, Dim5
- The user change the order of dimension to have a new pivottable (ex : Dim1, Dim4, Dim3, Dim2, Dim5)
- Now I want with one clic to reset the pivottable, it means I want the dimension in the right order (Dim1, Dim2, Dim3, Dim4, Dim5)...But I don't know the number of each dimension (but I know the label or the definition of the dimension if it helps)
I find my solution.
I will change the definition of the dimension, the label and the conditional show. I didn't want to delete the dimension to keep the conditional show but I just find a way to replace it.
Moreover, I have a problem with MoveDimension. I don't know why but it doesn't work. I download the last update of QlikView but it doesn't change anything. The solution with MoveDimension was to sort the dimensions thanks to their label ( objProp.Dimensions(j).Title ), but I have to let this down.
Thanks for your help.