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
4 replies
Subscribers
4 subscribers
Views
1553 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Reports
160647 - no subject - Hi All,\n\nI'm new to Appian and I'm hav
paulr866
over 9 years ago
Hi All,
I'm new to Appian and I'm having an issue with grouping. I want to be able to select a start and end date (date picker) and then group the data by day, week, and month (radio buttons).
I'm hoping to be able to do this via the timestamp which is in the format 2015-08-07 11:23:12
Can someone please advise on a way to approach this?
Thanks
Paul
OriginalPostID-160647
Discussion posts and replies are publicly visible
0
Lakshmi Meyyappan
over 9 years ago
I'm starting with a few assumptions: I'm assuming that you're using a!queryEntity() and that you're using a!queryAggregation() inside it. If this is the case, then you won't be able to group by day/week/month based on the timestamp field.
My recommendation is to create a SQL View for the data. You can create a view to include the relevant columns from your table as well as calculated columns for day, week, and month. Then if you create a cdt to map to your view and use a!queryEntity on that cdt, you will be able to aggregate on the day/week/month fields.
If you decide to set up your data this way, then you should be able to follow this SAIL Recipe for the start/end date filters and aggregation:
forum.appian.com/.../SAIL_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
paulr866
over 9 years ago
Brilliant thanks for your help
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
paulr866
over 9 years ago
Hi lakshmim,
I have created a new report view and split the columns into day,week,month, and year as you suggested however i'm having trouble getting it to function with my radio buttons. i'm getting the following error
Could not display interface. Please check definition and inputs.
Interface Definition: Expression evaluation error at function a!queryAggregationColumn [line 67]: The a!queryAggregationColumn function has an invalid value for the “aggregationFunction” parameter. When “isGrouping” is null or false, “aggregationFunction” must not be null or empty.
I have inserted the following query. Can you advise what 'm doing wrong?
a!queryAggregationColumn(
field: "DayPart",
isGrouping: if(
rule!APN_isEmpty(
local!groupByFilter
),
{},
a!queryFilter(
local!groupByFilter = "Day",
True(),
False()
)
)
),
Thanks
Paul
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
paulr866
over 9 years ago
Also the rule in the query is defined like this
if(fn!isnull(ri!array),true(),length(ri!array)=0)
Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel