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
1188 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
0
aswinb
over 10 years ago
...(local!yearList)),
local!monthIndices: makerange(count(local!monthList)),
a!formLayout(
label:"Hi",
firstColumnContents:{
a!textField(
label:"Hi",
value: local!dates,
saveInto:local!dates
)
})
)
)
Now I would like to get the count of all items that were created in the same month and same year. The output should display like this:
March 2013: 2,
April 2013: 4,
January 2014: 10,
February 2014: 5,
March 2014: 8
I have posted two similar posts but I realized that i didn't provide enough details and were misleading. So can anybody help on this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
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
0
aswinb
over 10 years ago
thank you so much Jesse
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel