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
6 replies
Subscribers
4 subscribers
Views
2128 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Reports
151529 - no subject - Hi,\n\nAnybody has a clue as to why, whe
charlesb454
over 9 years ago
Hi,
Anybody has a clue as to why, when used for a task report column, the expression below blanks all column values?
if(isnull(pv!avgResponseTime), Completion(), todecimal(Completion()) - todecimal(pv!avgResponseTime[1]))
Changing the expression to
if(isnull(pv!avgResponseTime), Completion(), todecimal(1) - todecimal(pv!avgResponseTime[1]))
Gives the correct results. Thanks.
OriginalPostID-151529
Discussion posts and replies are publicly visible
0
sikhivahans
over 9 years ago
@charlesb Is pv!avgResponseTime a multi valued or array variable?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
charlesb454
over 9 years ago
Thanks for your time. It is declared as 'Multiple' (Variable can store multiple values). Note that I tried the above with a non array variable and got the same behavior. It seems like whenever I involve Completion() in the expression I get the issue, although doing Completion() - Completion(), for example, will work and display 0.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
From my experience I could say that isnull function won't work on the array variables in the report. Instead I would recommend to use length function. Few might think that using length function in case of null valued variable results in an error, but in portal report it executes perfectly. Actually in your case, isnull always returns false.
As you are saying that it isn't working on non Multiple type variable, this is some thing which should be given thought of. I didn't use this till now, but I would get back to you if I get leads. Just aimed at adding a suggestion in case of null check on array variable.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
charlesb454
over 9 years ago
Thanks for your input - for now I'll try to work around the issue by doing the calculation outside the portal report. As a note, isnull returns true if the pv is not defined on some instances (older versions) of the underlying process model.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@charlesb If needed, probably you could overcome that behavior by depending on the pm!version property. I remember doing some thing similar few months back.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
charlesb The problem is being seen when the todecimal(pv!avgResponseTime[1])) is evaluating to null. Completion() is working perfectly as per my observations. Control the null valued array variable by making use of index function.
I believe the following expression should solve the issue:
if(
length(
pv!avgResponseTime
) = 0,
Completion(),
todecimal(
Completion()
) - todecimal(
index(
pv!avgResponseTime,
1,
0
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel