Exporting MDX query result to CSV file using ADOM library - ssas

In my code, I am using ADOM library to export MDX query result to CSV/xlsx file. It exports the data successfully in CSV/xlsx file format. But there is an additional tag All-M or All-L appended with Row and Column while there is no tag in SSAS (export the data from same ADOM to CSV).
I tried to remove All Level check box, remove (All) Level name and (All) Member name.
Export from icCube containing additionals tags All-L and All-M:
[Stress Scenarios].[Stress Scenario].[All-L].[MEMBER_CAPTION]
[Snapshots].[Reference Date].[All-M].&[2018-01-02].[Measures].[Market Value Sensitivity]
Export from SSAS :
[Stress Scenarios].[Stress Scenario].[MEMBER_CAPTION]
[Snapshots].[Reference Date].&[2018-01-02T00:00:00].[Measures].[Market Value]
I need an export output from icCube as below
Export from icCube:
[Stress Scenarios].[Stress Scenario].[MEMBER_CAPTION]
[Snapshots].[Reference Date].&[2018-01-02T00:00:00].[Measures].[Market Value]

Related

How can I export an entire SQL Server table to CSV, when the table contains an Image column?

I have a SQL Server table with the following design:
I need to export this entire table to a CSV file, with the data looking like this in plain-text format:
When I use the Import/Export wizard in SSMS, I get the following results in the CSV:
As you can see, this doesn't contain the actual binary data from the Image columns.
Instead, it just says System.Byte[] in plain-text, in each row.
In the past I've copy/pasted the text directly from the SSMS results window, into notepad, to manually produce the CSV.
However this table is so long, and the images are so large, that my computer runs out of memory if I try this now.
There must be a method to export the binary data into a CSV, in 0x1234ABCD format (hex).
How could I accomplish this?
if you are a developed you can create small C# app Useing Base64 encoding for your binary data. It converts any binary data into readable string. The code is as following
Encode
public static string Base64Encode(string plainText)
{
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
return System.Convert.ToBase64String(plainTextBytes);
}
Decode
public static string Base64Decode(string base64EncodedData)
{
var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
}
Following the advice in Dan Guzman's comment, I created a new view with the following query:
CREATE VIEW vwPhotosMen AS
SELECT SS,
CONVERT(varchar(max), CONVERT(varbinary(MAX), PhotoMen, 1), 1) AS PhotoMen,
CONVERT(varchar(max), CONVERT(varbinary(MAX), Thumbnail, 1), 1) AS Thumbnail
FROM dbo.PhotosMen
The SSMS Export Wizard was then able to export the data correctly from this view, to a plain-text CSV file.

How to export one of R's example datasets

How does one export a sample dataset (e.g., Lalonde).
I am able to run MATCHIT examples and export the output datasets from the MatchIt Process but I can't figure out how to export the source example dataset.
How can a reference to lalonde be made in this type of command:
tosas <- data.frame(m.data)
I'm new to R.
thanks
You can just bring in the data set with data() and then do what you want with it. It will be loaded as a data frame. You can export it to a CSV using write.csv(), for example.
data("lalonde", package = "MatchIt")
summary(lalonde)
write.csv(lalonde, file = "lalonde.csv")

Sap odata: Export a single Variable with abap

I have got a function module that counts some variables in sap system and export it as single INT4. But when I try to use this in gateway service, it says me
"no output table mapped" How can i overcome it, I tried to put this variable in a table and export then but I couldnt.
DATA: EV_ENQ TYPE STANDARD TABLE OF seqg3.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
guname = '*'
IMPORTING
number = EV_TABLESIZE
TABLES
enq = EV_ENQ.
Ev_Tablesize is the variable that I want to export. It holds the total lock count.
Your parameter should be mapped under your service implementation in SEGW. If it is not, then you should map them again and be sure that the parameter is being displayed.

In Hybris , How we can import product from database and store the product attribute value in csv file using Beanshell

I want to import product with attribute value Price , description and store in csv file using Beanshell script .
You can use export in Hac using a specific impex header.
I don't know the requirement but it's not proper to do it using beanshell since we have and import export framework.
You might have a look DefaultExportService. It can be used in a shell Script.
You could restrict your search results to return only a certain catalog/version(use in Hac/hMC):
$catalog=YourCatalogId
$version=YourCatalogVersion
"#% import de.hybris.platform.jalo.product.Product;"
"#% impex.setTargetFile( ""Products_and_price.csv"", true, 1, -1 );"
INSERT_UPDATE Product;code[unique=true];description[lang=en];description[lang=de];europe1Prices(price,currency(isoCode))
"#% impex.exportItems("" SELECT {p:pk} FROM {Product as p JOIN CatalogVersion as cv ON {cv:PK}={p:catalogVersion} JOIN catalog as c ON {c:pk}={cv:catalog}} WHERE {c:id}='$catalog' AND {cv:version}='$version'"", Collections.EMPTY_MAP, Collections.singletonList( Product.class ), true, true, -1, -1 );"
Add more languages for description if needed. Products are linked to their store through their catalog. You could search for this relation (catalog-store) on a new line, I'm not sure how to display this in one line.

Odoo Sales Order import results in wrong product line items

When I import a Sales Order, the resulting Quotation displays the wrong product. Here is the process I followed
Import a new customer with the following csv file which works as expected:
id,property_account_payable_id/id,property_account_receivable_id/id,notify_email,active,company_id/id,company_type,name
TestCustomer,__export__.account_account_15,__export__.account_account_7,All Messages,TRUE,base.main_company,Company,Test Customer
Import a new product, which works as expected:
id,active,description,categ_id/id,name,price,type,uom_po_id/id,uom_id/id,list_price,state
ABCDEF123456,TRUE,ABCDEF123456 Description,product.product_category_all,ABCDEF123456 Name,123,consu,product.product_uom_unit,product.product_uom_unit,453.67,
Import a new sales order, which does NOT works as expected:
id,partner_id/id,order_line/product_id/id,order_line/product_uom_qty
SalesOrder123456,TestCustomer,ABCDEF123456,1
Here is the export of the result of importing the sales order csv above:
"id","partner_id/id","order_line/product_id/id","order_line/product_uom_qty"
"SalesOrder123456","TestCustomer","__export__.product_product_13639","1.0"
If I go into Settings > Sequences & Identifiers > External Identifiers and search for "13639", I get a result of a completely different product which was imported earlier.
Anybody have any idea what is going on here? This seems like a bug in the import process.
Instead of using csv for import,you can use pgadmin(postgresql gui tool).Just select your database name and in the top you can see sql enabled,click it and issue an sql query(you must know the table name which you want to retreive) after that you can export it and import in your desired DB.