Hi community,
I would like to ask what will be the solution available if i want to filter the dataset criteria as below
Different data set contains either interim or final.
If the data set show as "Interim", then filter out " equal to or more than Period 13 ".
If the data set show as "Final" , then include " equal to or more than Period 13".
Thank you in advance
Solved! Go to Solution.
Why does Period 14 get filtered out too? From your criteria, you can use a Filter Tool with "Custom Filter":
NOT ([Type] = "Interim" AND [Period] = "Period 13")
But that wouldn't match the output you provided. Is there more dynamic logic involved?
Hi @AndrewDMerrill ,
Sorry for the confusion caused, basically i plan to filter period 13 onward which mean if the period more than or equal to 13, then filter out.
Thanks
@SH_94 your Type = Final data output does not make sense if you want to include >= period 13 then you should only have 1 record. Period 6,11 & 12 does not match the equal to or more than 13
regards
Tam
Hi @SH_94
I am still confuse about your condition for the final data. However,
Let's make a few assumptions about your use case.
As a user I want the workflow to determine the type and apply the appropriate filtering rule for it, because at any given stage the source data type could be interim or final.
I went down a rabbit hole: Smells like a Batch Marco, Smells like and App with checkbox and Detour.. then I wrote out the logic as follow:
1. The input could have either Final or Interim for Type variable.
2. Essentially an If statement for the filter tool along the line of:
if type = interim then apply this logic: not ([Type]="Interim" and [Period]="Period 13")
elseif type = final then apply this logic: not ([Type]="Final" and [Period]=null())
Then I wondered if I could write an If else statement into the custom filter function (I was not aware I could do this) .
if [Type]="Interim" then
!([Type]="Interim" and tonumber(right( [period],Length([period])-7))>= 13)
elseif [Type]="Final" then
[Type]="Final" and [Period]!=null()
else
[Type]=Null()
endif
Attached is the sample workflow.
HTH
Tam