icCube - How can I modify the information that will be exported in Excel file - excel

This the OutPut of my Excel file :
I want to Change the date to be more comprehensible. Thanks for your Help

This is known issue, will be part of next release.
As a workaround you can use DateToString function in your measure.
DateToString function does not convert currently, will be done in the next release, measures to their values (see issues).
As a workaround you'll have to do this manually :
[Measures].[My Date].value
or
[Measures].[My Date].value->asValue()
The second is needed if you're using a special aggregation method (e.g. min/max/open/close ) and will need Java to be active in icCube (doc)

Related

Node.js - Oracle DB and fetchAsString format

I am stuck on a problem and I am not sure what is the best way to solve it. I have a date column that I want to select and I want to fetch it as a string. Which is great, node-oracledb module has this option with fetchAsString mehotd. But it fetches the date like this for example 10-JAN-16 and I want to fetch it like this 10-01-2016. Is there a way to do that from the node-oracledb module, or I should modify the date after I get the result from the query?
UPDATE: I mean solution without to_char in the query and without query modifications
Check out this section of my series on Working with Dates in JavaScript, JSON, and Oracle Database:
https://dzone.com/articles/working-with-dates-using-the-nodejs-driver
The logon trigger shows an example of using alter session to set the default date format. Keep in mind that there is NLS_DATE_FORMAT, NLS_TIMESTAMP_FORMAT, NLS_TIMESTAMP_TZ_FORMAT.
I only show NLS_TIMESTAMP_TZ_FORMAT because I convert to that type in the examples that follow as I need to do some time zone conversion for the date format I'm using.
Another way to set the NLS parameters is to use environment variables of the same name. Note that this method will not work unless you set the NLS_LANG environment variable as well.

export data from gams to excel

I have a mathematical model and I want to run it 10 times automatically with different data sets which are generated randomly(when the first model stops, start another model automatically). for this purpose I have written the solve statement in a loop . I want to see the result of these 10 models in different sheets of an excel file. how can I do it? is it possible to correct my code?
set k/sheet1*sheet10/;
loop(k,
data generation....
solve statement....
execute_unload 'RESULT.gdx'
execute 'gdxxrw.exe RESULT.gdx o=RESULT.xlsx var=x.l rng='k.t1:0'!a1'
);
I really appreciate your kind helps
Actually, you are pretty close already, you just need to use 'put_utility' instead of 'execute' to make use of the 'k.tl' syntax (note: it is .tl, not .t1):
*dummy put file
file fx; put fx;
set k/sheet1*sheet10/;
loop(k,
solve statement....
execute_unload 'RESULT.gdx'
put_utility 'exec' / 'gdxxrw.exe RESULT.gdx o=RESULT.xlsx var=x.l rng='k.tl:0'!a1';
);
I hope that helps!
Best regards,
Lutz

Cross Object References Workfront text editor

Hello I am attempting to link data that is connected to a task on a project report using the text editor.
So far I have this as my code:
displayname=Recvd Medical Rates
linkedname=project:tasks
namekey=DE:Documentation Received Date
querysort=project:tasks:Document - Medical Rates:Documentation Received Date
textmode=true
valuefield=Documentation Received Date
valueformat=customDateAsString
I need to display data from a specific task within a specific custom form on a project report. I know there is no standard method of linking a project with a task, but the relationship is there and from my research It seems possible. I believe that I do not have the correct syntax.
Can somebody please help me with this. I have tried all types of combinations, I even tried adding the aggregator:
aggregator.displayformat=customDateAsString
aggregator.function=MIN
aggregator.namekey=Documentation Received Date
aggregator.valuefield=DE:Documentation Received Date
aggregator.valueformat=customDateAsAtDate
Either way I try and link the information the actual entered data will not display. So far the report knows that it is a date field; I know this because I am able click into the field on the project report and choose a date, but the date will not remain selected once I have chosen it leading me to believe that the field is somehow linked, but done incorrectly.
Please help.
The answer is below:
displayname=Plans and Benefits Received
listdelimiter=
listmethod=nested(tasks).lists
textmode=true
type=iterate
valueexpression=IF(CONTAINS("Plans and Benefits",{name}),{actualCompletionDate})
valueformat=HTML
So how does it work? see below.
displayname=Plans and Benefits Received
^display name that you want^
listdelimiter=
^decides delimiter^
listmethod=nested(tasks).lists
^Calls the nested or sub task^
textmode=true
^allows text editor mode to function^
type=iterate
^make data display as an iteration of original^
valueexpression=IF(CONTAINS("Plans and Benefits",{name}),{actualCompletionDate})
^determines where the data is being pulled from^
valueformat=HTML
^Format set to HTML^

How to Create new Excel file out from seleniumRC result?

I'm creating a test case using selenium RC.
The General flow of the process is to get data from an Excel File.
Then run the SeleniumRC.
To get the result I place a printout command. All output is visible in the console. (using eclipse)
What I need to do next is to store all this data into a new Excel File. Can anyone help me on how to generate my output into an excel file.
Store the result in variables and then write them into the excel using the Java Excel API.
Use Jexcel API.This link may be useful to you.
http://r4r.co.in/java/apis/jexcel/
A simply way I will suggest is to append all the printout statements in a storage variable like string buffer(Java) with delimiters like | symbols at the end of each line and then write this information into a text file.(line by line by split with the help of | symbols)
If you want to store this information in excel you will have to use the Apache POI Project to write data into excel sheets.(http://poi.apache.org/)

Not using colnames when reading .xls files with RODBC

I have another puzzling problem.
I need to read .xls files with RODBC. Basically I need a matrix of all the cells in one sheet, and then use greps and strsplits etc to get the data out. As each sheet contains multiple tables in different order, and some text fields with other options inbetween, I need something that functions like readLines(), but then for excel sheets. I believe RODBC the best way to do that.
The core of my code is following function :
.read.info.default <- function(file,sheet){
fc <- odbcConnectExcel(file) # file connection
tryCatch({
x <- sqlFetch(fc,
sqtable=sheet,
as.is=TRUE,
colnames=FALSE,
rownames=FALSE
)
},
error = function(e) {stop(e)},
finally=close(fc)
)
return(x)
}
Yet, whatever I tried, it always takes the first row of the mentioned sheet as the variable names of the returned data frame. No clue how to get that solved. According to the documentation, colnames=FALSE should prevent that.
I'd like to avoid the xlsReadWrite package. Edit : and the gdata package. Client doesn't have Perl on the system and won't install it.
Edit:
I gave up and went with read.xls() from the xlsReadWrite package. Apart from the name problem, it turned out RODBC can't really read cells with special signs like slashes. A date in the format "dd/mm/yyyy" just gave NA.
Looking at the source code of sqlFetch, sqlQuery and sqlGetResults, I realized the problem is more than likely in the drivers. Somehow the first line of the sheet is seen as some column feature instead of an ordinary cell. So instead of colnames, they're equivalent to DB field names. And that's an option you can't set...
Can you use the Perl-based solution in the gdata instead? That happens to be portable too...

Resources