具有SSAS数据源的SSRS中的订单参数值

问题描述

我正在使用VS / SSDT构建报告,并尝试对来自SSAS(表格)数据源的参数列出的可用值进行排序。在模型中,我用适当的排序填充了月份名称的“按列排序”属性,当我在“数据集属性”窗口中使用“查询设计器”构建查询时(以及当我通过Excel连接时),它可以工作。但是,当我在报表预览中或发布后查看参数时,月份名称列将按字母顺序而不是根据我的排序列进行排序。

如何定义参数值的排序?

如果有帮助,我正在使用SQL 2016,这是生成的查询:

DEFINE VAR vConsultantsReportingConsultantNameReporting1 = IF(PATHLENGTH(@ConsultantsReportingConsultantNameReporting) = 1,IF(@ConsultantsReportingConsultantNameReporting <> "",@ConsultantsReportingConsultantNameReporting,BLANK()),IF(PATHITEM(@ConsultantsReportingConsultantNameReporting,2) <> "",PATHITEM(@ConsultantsReportingConsultantNameReporting,2),BLANK()))
VAR vConsultantsReportingConsultantNameReporting1ALL = PATHLENGTH(@ConsultantsReportingConsultantNameReporting) > 1 && PATHITEM(@ConsultantsReportingConsultantNameReporting,1,1) < 1
VAR vTimesheetDateFisYearNumber1 = IF(PATHLENGTH(@TimesheetDateFisYearNumber) = 1,IF(@TimesheetDateFisYearNumber <> "",@TimesheetDateFisYearNumber,IF(PATHITEM(@TimesheetDateFisYearNumber,PATHITEM(@TimesheetDateFisYearNumber,BLANK()))
VAR vTimesheetDateFisYearNumber1ALL = PATHLENGTH(@TimesheetDateFisYearNumber) > 1 && PATHITEM(@TimesheetDateFisYearNumber,1) < 1
VAR vTimesheetDateFisMonthName1 = IF(PATHLENGTH(@TimesheetDateFisMonthName) = 1,IF(@TimesheetDateFisMonthName <> "",@TimesheetDateFisMonthName,IF(PATHITEM(@TimesheetDateFisMonthName,PATHITEM(@TimesheetDateFisMonthName,BLANK()))
VAR vTimesheetDateFisMonthName1ALL = PATHLENGTH(@TimesheetDateFisMonthName) > 1 && PATHITEM(@TimesheetDateFisMonthName,1) < 1
VAR vTimesheetDateFisWeekNumber1 = IF(PATHLENGTH(@TimesheetDateFisWeekNumber) = 1,IF(@TimesheetDateFisWeekNumber <> "",@TimesheetDateFisWeekNumber,IF(PATHITEM(@TimesheetDateFisWeekNumber,PATHITEM(@TimesheetDateFisWeekNumber,BLANK()))
VAR vTimesheetDateFisWeekNumber1ALL = PATHLENGTH(@TimesheetDateFisWeekNumber) > 1 && PATHITEM(@TimesheetDateFisWeekNumber,1) < 1
EVALUATE SUMMARIZECOLUMNS('Consultants Reporting'[Consultant Name Reporting],'Company Territory'[Territory],'Commissions'[Com Commission Percent],'Customers'[Customer Number],'Customers'[Customer Name],FILTER(VALUES('Consultants Reporting'[Consultant Name Reporting]),((vConsultantsReportingConsultantNameReporting1ALL || 'Consultants Reporting'[Consultant Name Reporting] = vConsultantsReportingConsultantNameReporting1))),FILTER(VALUES('Timesheet Date'[Fis Year Number]),((vTimesheetDateFisYearNumber1ALL || 'Timesheet Date'[Fis Year Number] = VALUE(vTimesheetDateFisYearNumber1)))),FILTER(VALUES('Timesheet Date'[Fis Month Name]),((vTimesheetDateFisMonthName1ALL || 'Timesheet Date'[Fis Month Name] = vTimesheetDateFisMonthName1))),FILTER(VALUES('Timesheet Date'[Fis Week Number]),((vTimesheetDateFisWeekNumber1ALL || 'Timesheet Date'[Fis Week Number] = vTimesheetDateFisWeekNumber1))),FILTER(VALUES('Company'[Company Name]),('Company'[Company Name] = "ABC Company,Inc.")),FILTER(VALUES('SBU Reporting'[SBU Name Reporting]),('SBU Reporting'[SBU Name Reporting] = "Base") || ('SBU Reporting'[SBU Name Reporting] = "Gland")),"Reporting Bill Amount",[Reporting Bill Amount],"Reporting Gross Margin $",[Reporting Gross Margin $],"Reporting Gross Margin %",[Reporting Gross Margin %],"Reporting MTD Bill Amount",[Reporting MTD Bill Amount],"Reporting MTD Gross Margin $",[Reporting MTD Gross Margin $],"Reporting MTD Gross Margin %",[Reporting MTD Gross Margin %],"Reporting YTD Bill Amount",[Reporting YTD Bill Amount],"Reporting YTD Gross Margin $",[Reporting YTD Gross Margin $],"Reporting YTD Gross Margin %",[Reporting YTD Gross Margin %],"Reporting Com Commission Amount",[Reporting Com Commission Amount],"Reporting QTD Bill Amount",[Reporting QTD Bill Amount],"Reporting QTD Gross Margin $",[Reporting QTD Gross Margin $],"Reporting QTD Gross Margin %",[Reporting QTD Gross Margin %],"Reporting PYTD Gross Margin $",[Reporting PYTD Gross Margin $],"Reporting PYTD Bill Amount",[Reporting PYTD Bill Amount],"Reporting PYTD Gross Margin %",[Reporting PYTD Gross Margin %])

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...