我的报告需要统计每天进入车站的车辆数量。我为date字段创建了一个组,并创建了接受该结果的公式。它计算记录,但也计算前几天的记录:
date vno vehile_type job_done
1/3/2017 aa123 hero cha
1/3/2017 aa123 hero cha
1/3/2017 aa123 herohonda cha英雄不:2不英雄:1
2/3/2017 aa123 hero cha
2/3/2017 aa123 herohonda cha
2/3/2017 aa123 herohonda cha英雄不:3不英雄:3
这是我的公式
用于"count1“公式
numbervar totalcount;
If {vehicle.vtype} = "HeroHonda" then
totalcount := totalcount +1
else
totalcount := totalcountcount2公式
numbervar totalcount1;
If {vehicle.vtype} = "Hero" then
totalcount1 := totalcount1 +1
else
totalcount1 := totalcount1我需要得到如下结果
date vno vehile_type job_done
1/3/2017 aa123 hero cha
1/3/2017 aa123 hero cha
1/3/2017 aa123 herohonda cha英雄不:2不英雄:1
2/3/2017 aa123 hero cha
2/3/2017 aa123 herohonda cha
2/3/2017 aa123 herohonda cha英雄不:1不英雄:2
发布于 2017-03-01 08:06:34
从您提供的内容来看,我看到您有组date,因此,要使其正常工作,您错过的唯一事情就是每天重置变量。您需要做两个新的公式,这将为每天重置您的变量,您稍后将显示在组页脚(我想)。
制作新公式reset1
numbervar totalcount:=0;和reset2
numbervar totalcount1:=0;并将它们放置在字段date的组标题中,以便它们每天重置。抑制他们,使他们不显示在实际报告,但做背后的逻辑,以计数。
希望它能帮上忙
https://stackoverflow.com/questions/42525830
复制相似问题