2017-08-17 111 views
0
ordertype actual actual YTD 
A   900  1500 
B   500  2000 
C   200  2200 
D   300  2500 

实际列应该从计算值(减去开始日期月份的当前日期)。YTD(年初至今)日历一面旗帜的QlikView

实际YTD应该计算基于年的当前日期减去开始日期

这里开始日期月/年应4月1日(财政年度)

+2

欢迎堆栈溢出,请花时间去通过[欢迎浏览](https://stackoverflow.com/tour)了解你在这里的方式(并获得你的第一张徽章),阅读如何[创建一个最小,完整和可验证的示例](https:// stackoverflow。 com/help/mcve),并检查[如何提出好问题](https://stackoverflow.com/help/how-to-ask),以便增加获得反馈和有用答案的机会。 –

回答

0

在脚本中使用InYearToDateInMonthToDate

用例例如:

Load distinct 
    Date, 
    if(InYearToDate(Date,today(),0,4),1,0) as YTD, // the "4" mean that The year start at the 4th month, 
    if(InMonthToDate(Date,today(),0),1,0) as MTD 
resident DataTable 

现在哟乌尔日历表,你的YTD和MTD领域,你可以像这样使用它们:

sum({<YTD={1}>} Actual) 

,了解更多有关这些功能的访问here