This project has moved and is read-only. For the latest updates, please go here.

R metric displays empty rows

Sep 18, 2013 at 6:23 AM
Hi,

We have successfully integrated R using R Integration Pack in MSTR.
We also wrote a sample script as given in the example(PAGE 25 of RIntegrationPackUserGuide PDF) and successfully created a derived metric in MSTR and obtained the expected results.
The example which is given in the PDF uses linear regression algorithm.

After that we wrote an R script using Arima algorithm and used the formula in the derived metric as we did in our previous example. But it is not giving us any result in the report. The formula is a valid expression which is not showing any error while creating the derived metric but when we execute the report, it is not giving any result. That derived metric column returns only empty rows.

So, we have a doubt whether it is possible to use any other script/algorithm other than the one which is given in the PAGE 25 of RIntegrationPackUserGuide PDF ?
Coordinator
Sep 18, 2013 at 5:59 PM
Sorry that you've encountered problems. Let's see if we can figure out what's going on.

When you see empty results, that usually means there was a problem executing the R script. We try to capture these errors in a RScriptErrors.log file that is usually stored in the directory where the R Script is located. Fundamental problems will be logged automitically, like not being to find the R script or an R Script that has a syntax problem. But to diagnose problems when the script executes, it helps to follow some of the best practices in the user guide. In particular,

Can you find any RScriptErrors.log files?
  • Implementing the tryCatch function wrapper for error handling, page 10
    --> Any caught errors will appear in the RScriptErrors.log file.
  • Saving the R workspace, page 12
    --> Saving the workspace to an .Rdata file allows you to see actual data passed in by MicroStrategy along with any saved objects.
  • Configuring dual execution modes, page 13
    --> It's always good to make sure the R script runs properly using the R Console and local data. This way, if there's a problem after deploying the analytic to MicroStrategy, you can be confident that the script is working properly and you can focus on the MicroStrategy execution considerations (is the script in the right location, is the correct data being passed in as inputs, etc.).
Have you implemented these best practices in your script?

Best regards,

Rick
Sep 20, 2013 at 8:03 AM
Hi rpechter,

Thanks for your support

We just followed your instructions. Our issue got issue got resolved
Coordinator
Sep 23, 2013 at 5:44 PM
That's excellent -- congratulations!

Do you have any feedback on what we could improve to make your experience better?

Good luck!

Rick
Sep 24, 2013 at 6:02 AM
I would suggest you to provide more brief sessions on the porcedures to follow during the R integration process. So that it will help you in increasing the number of users who will use RIntegration pack for Predictive Analytics.
Coordinator
Sep 24, 2013 at 6:57 AM
Thank you for your feedback! We'll be working on that.
Oct 17, 2013 at 3:10 AM
I'm also getting a blank row when running the script. When looking at the DSS log, I see the following error:

2013-10-16 21:56:48.816-05:00 [HOST:DEMO][PID:4032][THR:3968][Metadata Server][Error][0x8004140B] Object with ID '777BA0094B060DB764AF09B9C9C1A0F0' and type 11 (Function) is not found in metadata. It may have been deleted.

Does this mean that the R functions have not been deployed to the server?
Coordinator
Oct 22, 2013 at 3:46 PM
I don't think so, because if the R functions weren't there, you wouldn't have been able to create an object that refers to it in the first place. This is really a problem for MicroStrategy Tech Support, hopefully they can help.
Oct 24, 2013 at 1:28 PM
Hi, Rick. I was curious about the RSSErrorlog.txt file. I've just run a simple R script that maps an input metric from MSTR that returns a single row to the output variable in R as a test. I've included everything in the Try/Catch, but when i run the metric in a grid, i get a null value back in the report. Looking through the RSSErrorlog doesn't show anything. How can i catch whatever is happening between the R engine and MSTR to determine why the metric value is Null?
Coordinator
Oct 24, 2013 at 9:41 PM
It seems like you're hitting a problem that is evading the tryCatch... would you mind opening a Tech Support Case for this issue so we can follow-up get the details about your script, your environment, etc. Getting you into our standard support process will help us get to the bottom of this problem more quickly than we can thru this discussion. Once we have a solution, I'll reply back to close the loop here for everyone's benefit.

Thanks,

Rick
Jan 7, 2014 at 8:18 AM
Hi,

We need to do a POC for one of our customers. As a test, I first tried the example in the PDF, but only empty rows are returned.
I tried to find the RScriptErrors.log file, but I cannot find it anywhere.
What should be the default location for this? Or is there a way to configure this?
Coordinator
Jan 7, 2014 at 9:30 PM
Sorry you're having problems. Empty rows are an indication that your R analytic didn't execute properly. The RScriptErrors.log should be found in the Working Directory (if you specified one) or the RScript's folder. If you cannot find the RScriptErrors.log file, it could be because that location is not writeable when MicroStrategy tries to save the log file there -- you can check the permissions on this folder to make sure. You should also check the DSSErrors.log file which should also have entries associated with problems logged by the RScript function. Note that errors are logged where the R Analytics execute: that's on the Intelligent Server, except when using Desktop connected 2-tier or using derived metrics in 3-tier then it would be on the Desktop machine.

If you still have problems, please provide more details, including:
  • Operating System for I-Server and Client
  • Type of Client (Desktop or Web)
  • Type of metric (is it derived or not)
Good luck,

Rick
Jan 9, 2014 at 2:49 PM
Hi Rick,

Thanks for your reply.
I've tried to have a closer look at the logs.

In the RScriptErrors.log:
CRFPCommonNNGEN::ExRScript: R script execution failed with no error message. Possible causes: execution error outside tryCatch() or syntax error.

And the same in the DSSErorrs.log:
2014-01-09 15:41:53.814+01:00 [HOST:W7-008865][PID:9684][THR:10008][Analytical Services][Error][0x80002434] Plug-in function error analytical engine:[CRFPCommonNNGEN::ExRScript: R script execution failed with no error message. Possible causes: execution error outside tryCatch() or syntax error.]

Any idea what is causing this?
As it is for a POc, I'm currently working on a Windows 7 OS for both I-server and client.
Problems occur in both desktop and web.

Regards,
Koen
Coordinator
Jan 9, 2014 at 10:24 PM
So, that's one clue: R script execution failed with no error message. Possible causes: execution error outside tryCatch() or syntax error.]

This points to a problem with execution of your R script. MicroStrategy can find the script and run it, but there's a error with executing the script in R.

In order to help debugging, there are Best Practices in the User Guide that can help you figure out what's going on, or prevent problems in the first place. For example,
  • Are you using the tryCatch approach (see Implementing the tryCatch function wrapper for error handling)? I think not since, if you did, the error message would have appeared in the log.
  • Have you verified the R script runs from the R console on both the I-Server and Client (see Configuring dual execution modes)?
  • Have you ensure any required packages installed?
Worst case, perhaps you can share your script here and maybe we can identify the problem that way.

Good luck,

Rick