计算成员以获取上一年的维度值

时间:2015-04-22 09:46:39

标签: ssas mdx cube

我是BI的新手,需要帮助才能创建计算成员。

我有一个具有以下维度和度量的多维数据集:

  • 尺寸表: Dim_Time (年,月,日)

  • Dim_MyValueCollection :数据类型具有值'总付费索赔的数据类型'和#Gross书面保费'

  • 测量: FactTable.Value

我需要在 Dim_MyValueCollection.DataType 上创建一个计算成员,以表示“Gross Written Premiums”的差异'当前和上一年的价值。

1 个答案:

答案 0 :(得分:0)

要从Lag中获取上一期间的数据,您可以使用以下功能:

ParallelPeriod

https://msdn.microsoft.com/en-us/library/ms144866.aspx

mdx

https://msdn.microsoft.com/en-us/library/ms145500.aspx

您是否尝试过任何tuple

修改

以上是Gross Written Premiums自上一年同期以来的变化的一般mdx。我已经猜到了维度的名称,因为您没有提供任何样本([Time].CURRENTMEMBER, [Measures].[Gross Written Premiums]) - (PARALLELPERIOD(Year,1,[Time].CURRENTMEMBER), [Measures].[Gross Written Premiums])

namespace Form1
{
public partial class Form1 : Form
{
    public BackgroundWorker backgroundWorker1 = new BackgroundWorker();
    public OpenFileDialog fd = new OpenFileDialog();

    public Form1()
    {
        InitializeComponent();
        backgroundWorker1.WorkerReportsProgress = true;
        backgroundWorker1.WorkerSupportsCancellation = true;
        backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
        backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
    }
    private void btn_Two_Click(object sender, EventArgs e)
    {
        fd.Title = "Select The Text File To Open";
        fd.Filter = "Text Files|*.txt";
        fd.InitialDirectory = @"C:\";
        if (fd.ShowDialog() == DialogResult.OK)
        {
            TextFiles(sender);
        }
    }
    private void TextFiles(object sender)
    {
        IEnumerable<String> employeeNames = File.ReadLines(fd.FileName);
        foreach (string pgs in employeeNames)
        {
            employee = pgs;
            ProcessTables(employee, sender);
        }
    }
    private void ProcessTables(string employee, object sender)
    {
        sw.Restart();
        timer.Start();
        //This line is where the compiler throws the error
        backgroundWorker1.RunWorkerAsync();            
    }
    private void backgroundworker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
    {
      progressBar1.Value = e.ProgressPercentage;
    }
    private void backgroundworker1_DoWork(object sender, DoWorkEventArgs e)
    {
      //Never hits this block so I will omit this code for time sake
    }
}
}