public void SimpleWay() { var axisSlicerMember = new MdxMember(); axisSlicerMember.Titled("Dim Hierarchy", "Dim"); var axisSlicer = new MdxTuple(); axisSlicer.With(axisSlicerMember); var axis = new MdxAxis(); axis.Titled(MdxAxisType.Columns); axis.AsNonEmpty(); axis.WithSlicer(axisSlicer); var cube = new MdxCube(); cube.Titled("Cube"); var querySlicerMember = new MdxMember(); querySlicerMember.Titled("Dim Hierarchy", "Dim", "Dim Key"); querySlicerMember.WithValue("1"); var querySlicer = new MdxTuple(); querySlicer.With(querySlicerMember); var query = new MdxQuery(); query.On(axis); query.From(cube); query.Where(querySlicer); }
/// <summary> /// Appends the specified <see cref="MdxTuple"/> and returns the updated current instance of <see cref="MdxSet"/>. /// If there are any children other than <see cref="MdxTuple"/> then each child will be wrapped into <see cref="MdxTuple"/>. /// </summary> /// <param name="tuple">Specified <see cref="MdxSet"/>.</param> /// <returns>Returns the updated current instance of <see cref="MdxTuple"/>.</returns> public MdxSet With(MdxTuple tuple) { if (!_children.Any()) { _children.Add(tuple); return this; } if (_children.OfType<MdxTuple>().Any()) { _children.Add(tuple); return this; } var copiedChildren = new List<IMdxMember>(_children); _children.Clear(); foreach (var member in copiedChildren) _children.Add(Mdx.Tuple().With(member)); return this; }
/// <summary> /// Appends the <see cref="MdxTuple"/> into where clause and returns the updated current instance of <see cref="MdxQuery"/>. /// </summary> /// <param name="tuple">Specified <see cref="MdxTuple"/>.</param> /// <returns>Returns the updated current instance of <see cref="MdxQuery"/>.</returns> public MdxQuery Where(MdxTuple tuple) { _whereClauseTuples.Add(tuple); return this; }
public MdxDeclaration As(MdxTuple expression) { Expression = expression; return this; }
/// <summary> /// Sets the slicer for axis and returns the updated current instance of <see cref="MdxAxis"/>. /// </summary> /// <param name="slicer">Axis slicer.</param> /// <returns>Returns the updated current instance of <see cref="MdxAxis"/>.</returns> public MdxAxis WithSlicer(MdxTuple slicer) { AxisSlicer = slicer; return this; }