cancel
Showing results for 
Search instead for 
Did you mean: 

Last() function issue

Former Member
0 Kudos

I have a requirement to display the Log Solution/Log Comment activities from Service Desk tickets onto the new BOXI report. With the custom formula that uses Last() function which displays only on the first record and rest it just blanks out for some unknown reason. It would be great if anyone can share a solution who has achieved a fix to such problem in BOXI.

Accepted Solutions (1)

Accepted Solutions (1)

tanisha_gupta20
Participant
0 Kudos

Hi Vishnu,

Last function displays the last record in your report and that is why it is showing you just one record. If you are planning to display the latest log comment for a service desk ticket then try creating a universe objects with displays the max([Time Object]).

Then display the log comments where [Time Object]=max([Time Object])

Time Objects is the objects which captures your timestamp whenever a comment is logged

Hope that helps.

Regards,

Tanisha

Former Member
0 Kudos

Hi Tanisha,

I'm trying to display the service desk tickets records having log comments matching to a specific type and for other ticket records that doesn't match then just display the log comments as 'None'.

I have used the same Last() function on my 2 custom web intelligence reports that are slightly different in custom SQL query. On one report, this function works as expected by displaying all the log comments matching to the Last() function logic correctly and whereas on other report, it either displays for the first record or just blank depending on the filters used to run the report.

I will try your function to see if this may help to get the expected results and let you know but this may take a while as it is currently at the backburner.

Thanks,

Vishnu


tanisha_gupta20
Participant
0 Kudos

Sure.

If you are using the custom sql then I hope you are ordering your query result set correctly so that the Last() function picks the right values.

Regards,

Tanisha

Former Member
0 Kudos

Tanisha -

Basically my report is to display list of all tickets between start and end period along with Organization filter, where user is prompted to enter the desired value in these prompt selections. The report prints the correct list of Service Desk tickets data that includes various fields like ticket type (incident/problem/request), ticket number,opened date, closed date,configuration item, status and other fields along with displaying all activity logs. The requirement here is to display the activity log just specific to either the last "Log Comment" or "Solution" activity type entered in each ticket if any otherwise print 'None',

Obviously the Last() function doesn't do any good for my requirement in this report. Any suggestions on how I could display the last log comment or solution activity log for each ticket in my report ?

tanisha_gupta20
Participant
0 Kudos

Hi Vishnu,

I have managed to achieve the same results by the steps I have written above :

Last function displays the last record in the query result in your report and that is why it is showing you just one record. If you are planning to display the latest log comment for a service desk ticket then try creating a universe objects which displays the max([Time Object]).

Then display the log comments where [Time Object]=max([Time Object])

Time Objects is the objects which captures your timestamp whenever a comment is logged

You need to make sure that you have two different queries in your report. One containing [Time Objects] and other containing the max([Time Object])

Create another variable [Comment Flag] which says

=if([Time Objercts]=max([Time Objects]);"Y";"N")

Apply a block filter for [Comment Flag]="Y"

This should work.

Regards,

Tanisha

Former Member
0 Kudos

Hi Tanisha,

Thanks for the detailed steps and was wondering if there is an alternative to avoid creating a custom object universe for this requirement and accomplish using the formula's. Please advise if there is any such possibility.

-Vishnu

Answers (0)