Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: peterrHi Ryeh,
Thanks for this!... but I have one last problem that I can't figure out (sorry, I'm very new to Lavastorm, my background is accounting and excel, so still getting my head around some of the coding logic... but getting there).
One extra part I need to add is to also add the reel id to this logic. In the example below the first reel in the list is Reel 2 and Provision = Yes, so this returns NewOld as "New" = correct. The very next reel in the list is Reel Id 1, Provision = Yes, and since this is the first time Reel Id 1 appears in the list it should also be "New", but since the current code only looks at the Prov it gets flagged as "Old".... so how do I extend the existing logic to also check if this is the same reel id, or a new reel id?
Thanks in advance
Peter
node:BRD_Data
bretype:core::Static Data
editor:Label=ReportPeriod, ReelId, Prov
editor:sortkey=56325d20224b0481
output:@40fe6c55598828e5/=
prop:StaticData=<<EOX
ReportPeriod:string,ReelId:string,Prov:string
2015-05,2,Yes
2015-06,1,Yes
2015-07,1,No
2015-08,1,Yes
2015-09,1,Yes
2015-10,1,Yes
2015-11,1,Yes
2015-12,1,No
2016-01,1,Yes
EOX
editor:XY=160,300
end:BRD_Data
node:NewOld
bretype:core::Filter
editor:Label=New/Old
editor:sortkey=56325d29327d0866
input:@40fd2c74167f1ca2/=BRD_Data.40fe6c55598828e5
output:@40fd2c7420761db6/=
prop:Script=<<EOX
if firstExec
then PrevProv = Prov
if firstExec and Prov == "Yes"
then NewOld = "New"
else if Prov == "No"
then NewOld = ""
else if PrevProv == "No" # assuming that Prov is either Yes or No
then NewOld = "New"
else NewOld = "Old"
PrevProv = Prov
emit *,NewOld
EOX
editor:XY=330,300
end:NewOld