cancel
Showing results for 
Search instead for 
Did you mean: 

Calculated_Column Expression not functioning properly

Former Member
0 Kudos

Hello,

I am using a calculated_colum action block to insert two columns "PercentUtilized" and "PercentFree" in the XML.

In Configure Object, I ahve selected document source. I have defined two columns as Double in "Defined Columns".

For PercentUtilized, I am writing following expression which is not working:

stringif( DrilldownDepth == "1", (100 * TotalTime) / (datediffminutes(#Transaction.StartDate#  ,  #Transaction.EndDate# )) , (100 * TotalTime) / (24*60*30) )

DrilldownDepth and TotalTime both are coming from Source XML of Calculated_Column.

After execution, this action block adds two column PercentUtilized and PercentFree in the XML but its value comes as NA.

Can anyone plz help why is this not working?

Soham

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Soham,

Try change your expression to this:

stringif(DrilldownDepth == "1",(100 * TotalTime)/(number(datediffminutes(Transaction.StartDate,Transaction.EndDate))),(100 * TotalTime)/(24*60*30))

The value NA is probably because their start and end date are equal.

Hope this help.

Danilo Santos

Former Member
0 Kudos

Hi Danilo,

Thanks for the reply.

But the expression that you have suggested gives the same NA in the resultant XML for "PercentUtilized" and "PercentFree" columns.

I don't have slightest idea why the expression is not working

Soham

Former Member
0 Kudos

H Danilo,

I tried various permutation and combinations for tthe issue and now I have a feeling that we just can't use any Transaction or Local variable in Expression of Calculated_Column action block ..

It seems to be working that way .. I am not sure but I dont have any documentation to check that even

Can you please help in that?

Soham

Former Member
0 Kudos

Hello Soham,

Is it possible you work with Transaction or Local variables in Expression of Calculated_Column.

Tell me the input parameters:

DrilldownDepth = ?

TotalTime = ?

StartDate = ?

EndDate = ?

I made an example and returning NA when StartDate and EndDate values ​​were equal.

Danilo Santos