Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
3 replies
Subscribers
8 subscribers
Views
1199 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
I have the following code that has a rule(rule!PSA_PSAAssignmentsPSACountBtwTim
aswinb
over 10 years ago
I have the following code that has a rule(rule!PSA_PSAAssignmentsPSACountBtwTimeFrame) in the beginning that gives me all the items that were created between the ri!start and ri!end dates. And I have a local!dates input that has date values of all those items like 3/1/2013, 3/1/2013, 4/1/2014,...etc which means that 2 items where created on 3/1/2013 and 1 item was created on 4/1/2014. I am providing the code below:
=load(
local!count: 0 ,
with(
local!list: rule!PSA_PSAAssignmentsPSACountBtwTimeFrame(cons!PSA_MILESTONE_TYPES[1],ri!start,ri!end),
local!months: tointeger(apply(fn!month,local!list.Milestone_Date)),
local!years: tointeger(apply(fn!year, local!list.Milestone_Date)),
local!days: tointeger(apply(fn!day, local!list.Milestone_Date)),
local!dates: apply(fn!date, merge(local!years, local!months, local!days)),
local!monthList: apply(fn!month, local!dates),
local!yearList: apply(fn!year, local!dates),
local!yearIndices: makerange(count...
OriginalPostID-106472
OriginalPostID-106472
Discussion posts and replies are publicly visible
Parents
0
jesse.triplett
Appian Employee
over 10 years ago
Try this,
Step 1) Retrieve month/year concatenated
step 2)Get unique entries
Step 3) Count occurrences of unique entries.
Finally, I formatted it to output the display you listed, but just take the inner apply to get the data
monthYears:datetext(local!list.Milestone_Date,"MMM YYYY"),
uniqueDates:rule!APN_distinct(monthYears),
apply(concat(_,": ",_),merge(uniqueDates,apply(fn!count,merge(apply(wherecontains(_,monthYears),uniqueDates)))))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
jesse.triplett
Appian Employee
over 10 years ago
Try this,
Step 1) Retrieve month/year concatenated
step 2)Get unique entries
Step 3) Count occurrences of unique entries.
Finally, I formatted it to output the display you listed, but just take the inner apply to get the data
monthYears:datetext(local!list.Milestone_Date,"MMM YYYY"),
uniqueDates:rule!APN_distinct(monthYears),
apply(concat(_,": ",_),merge(uniqueDates,apply(fn!count,merge(apply(wherecontains(_,monthYears),uniqueDates)))))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data