how to load xml api data in mysql database using talend - etl

this is my xml structure
<DataSet xmlns="http://tempuri.org/">
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<finyear>2019-20</finyear>
<distCode>344</distCode>
<blockCode>3276</blockCode>
<DistrictName>ANUGUL </DistrictName>
<BlockName>ANUGUL </BlockName>
<target>24.00</target>
<Applied>4</Applied>
<totalvaw>1</totalvaw>
<totalorsac>1</totalorsac>
<totaldda>1</totaldda>
<totaldc>1</totaldc>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>
I have used these components
this is mapping of tXmlMap
I am not able to load data into mysql. Is there any problem in above components

Related

blueprintjs table error with example code

I am getting this error:
Uncaught Error: [Blueprint Table] <Table> Children of Table must be Columns"
at table.js:879`
Using the code:
<Table numRows={5}>
<Column />
<Column />
<Column />
</Table>
and version 2.0.0 of #blueprintjs/table
What are your imports? Make sure you are importing Column from #blueprintjs/table.

How to avoid scentific notation in Saiku Attribute

I define saiku(3.8) schema as below:
<?xml version="1.0" encoding="utf-8"?>
<Schema name="Zeus Offline Data" metamodelVersion='4.0'>
<PhysicalSchema>
<Table name="ZEUS_OFFLINE_DATA">
<Key>
<Column name='FB_ACCOUNT_ID'/>
</Key>
</Table>
</PhysicalSchema>
<Cube name="OfflineData">
<Dimensions>
<Dimension name="AdAccount" table="ZEUS_OFFLINE_DATA">
<Attributes>
<Attribute name="account_id" keyColumn="FB_ACCOUNT_ID" hasHierarchy="true"/>
</Attributes>
</Dimension>
<Dimension name="BM" table="ZEUS_OFFLINE_DATA">
<Attributes>
<Attribute name="bm_id" keyColumn="BM_ID" hasHierarchy="true"/>
</Attributes>
</Dimension>
</Dimensions>
<MeasureGroups>
<MeasureGroup name="Stats" table="ZEUS_OFFLINE_DATA">
<Measures>
<Measure name="clicks" column="CLICKS" aggregator="sum" formatString="#,###"/>
</Measures>
<DimensionLinks>
<FactLink dimension="AdAccount"/>
<FactLink dimension="BM"/>
</DimensionLinks>
</MeasureGroup>
</MeasureGroups>
It contains two dimension "bm_id" and "fb_account_id", and one measure "clicks".In database backend, bm_id and fb_account_id are int type. When I make query in Saiku, the result of bm_id and fb_account_id are shown in scientific notation mode, which I don't want.
Result:
bm_id clicks
1.71141391154125E14 1,091,234
Which I want:
171141391154125 1,091,234
I don't know which attribute should be changed for that, any help appreaciated
Thanks

Snowflake dimension with multiple levels mondrian

My tables structure is as follows
dim_question_tbl table with primary key dim_question_id_i(pk)
dim_grade_tbl -> dim_grade_id_i(pk), grade_name_c
dim_level_tbl -> dim_level_id_i(pk), level_name_c
dim_grade_question_tbl -> dim_grade_question_id_i(pk), dim_grade_id_i(fk), dim_level_id_i(fk)
Now i have to have the grade and level as the levels in dimension.
The cube written on the 'dim_question_tbl' table.
I have written the dimension as
<Dimension name="Grade" foreignKey="dim_question_id_i" highCardinality="false">
<Hierarchy hasAll="true" primaryKey="dim_question_id_i" primaryKeyTable="dim_grade_question_tbl">
<join leftKey="dim_grade_id_i" rightKey="dim_grade_id_i">
<table name="dim_grade_question_tbl" />
<join leftKey="dim_level_id_i" rightKey="dim_level_id_i">
<table name="dim_grade_tbl" />
<table name="dim_level_tbl" />
</join>
</join>
<Level name="EnterpriseID" column="dim_enterprise_id_i" table="dim_grade_tbl" uniqueMembers="true" visible="false"/>
<Level name="Grade" column="grade_name_c" table="dim_grade_tbl" uniqueMembers="true"/>
<Level name="Level" column="level_name_c" table="dim_level_tbl" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
This does not working. The exception i am getting is '[Grade]' must have at least one level.
I have tried it with sql query also as
<Dimension name="Grade" foreignKey="dim_question_id_i" highCardinality="false">
<Hierarchy hasAll="true" primaryKey="dim_question_id_i" primaryKeyTable="dim_grade_question_tbl">
<Query name="test">
<SQL dialect="generic">
SELECT *
FROM dim_grade_question_tbl, dim_grade_tbl, dim_level_tbl
WHERE dim_grade_question_tbl.dim_grade_id_i = dim_grade_tbl.dim_grade_id_i
and dim_grade_question_tbl.dim_level_id_i = dim_level_tbl.dim_level_id_i
</SQL>
</Query>
<Level name="Grade" column="grade_name_c" table="dim_grade_tbl" uniqueMembers="true"/>
<Level name="Level" column="level_name_c" table="dim_level_tbl" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
With the sql query also the same exception i am getting.
Could any one help me how can i get the multiple levels with the snowflake schema?

OLAP cube in schema workbench measures shows no data

Iv'e created a simple Schema in Jaspersoft OLAP designer. Now i want to publish my Cube in a view on jasperreport Server.
I managed to get this to work before with other Schemas but now i don't get any values out of my sum measures...
Can anyone see some Problem in here?
<Schema name="AbsatzView">
<Cube name="Budget" cache="true" enabled="true">
<Table name="vBudgetDetail" schema="dbo" alias="">
</Table>
<Dimension type="TimeDimension" foreignKey="ZeitID" name="GJahr">
<Hierarchy name="" hasAll="false" primaryKey="ID">
<Table name="vBudgetTimes" schema="dbo" alias="">
</Table>
<Level name="Gjahr" column="Gjahr" uniqueMembers="true" levelType="TimeYears">
</Level>
<Level name="Monat" column="Monat" uniqueMembers="false" levelType="TimeMonths">
</Level>
</Hierarchy>
</Dimension>
<Dimension type="StandardDimension" foreignKey="VersionID" name="Aktiv Version">
<Hierarchy hasAll="false" primaryKey="VersionID">
<Table name="vBudgetVersionAktiv" schema="dbo" alias="">
</Table>
<Level name="Version" column="version" type="String" uniqueMembers="false" levelType="Regular">
</Level>
</Hierarchy>
</Dimension>
<Dimension type="StandardDimension" foreignKey="VersionID" name="Vorherige Version">
<Hierarchy name="" hasAll="false" primaryKey="VersionID">
<Table name="vBudgetVersionV1" schema="dbo" alias="">
</Table>
<Level name="Version" column="version" type="String" uniqueMembers="false" levelType="Regular">
</Level>
</Hierarchy>
</Dimension>
<Measure name="Absatz Plan" column="PlanAbsatz" aggregator="sum" visible="true">
</Measure>
<Measure name="Umsatz Plan" column="PlanUmsatzLW" aggregator="sum" visible="true">
</Measure>
</Cube>
</Schema>
I know that this for example this mdx have to give me values in my measures but it's empty and i don't know why?
select {[Measures].[Absatz Plan]} ON COLUMNS,
{[GJahr].[2013], [GJahr].[2014], [GJahr].[2015]} ON ROWS
from [Budget]
If i use the same tables in SQL and asks exact for the same Thing i get correct values
SELECT b.Gjahr,SUM(a.PlanAbsatz) FROM vBudgetDetail a
INNER JOIN vBudgetTimes b ON b.ID = a.ZeitID
GROUP BY b.Gjahr
Try this query
select {[Measures].[Absatz Plan]} ON COLUMNS,
{[GJahr].&[2013], [GJahr].&[2014], [GJahr].&[2015]} ON ROWS
from [Budget]
Or this:
select {[Measures].[Absatz Plan]} ON COLUMNS,
{[GJahr].[GJahr].&[2013], [GJahr].[GJahr].&[2014], [GJahr].[GJahr].&[2015]} ON ROWS
from [Budget]

Accessing ancestor values in xpath with Solr DataImportHandler

If my xml is structured like so:
<fruit>
<apple appleId="apple_1">
<core coreId="core_1">
<seed>1</seed>
<seed>2</seed>
</core>
</apple>
<apple appleId="apple_2">
<core coreId="core_1">
<seed>1</seed>
</core>
</apple>
</fruit>
and I want the seeds to be the documents in my solr schema, how can I access the appleId and coreId?
Here's the pertinent entity definition from my data-config.xml:
<entity name="apples"
processor="XPathEntityProcessor"
stream="true"
forEach="/fruit/apple/core/seed"
url="fruit.xml"
transformer="script:create_id"
>
<field column="seed_s" xpath="/fruit/apple/core/seed" />
<field column="apple_id_s" xpath="/fruit/apple/#appleId" />
</entity>
script:create_id creates a unique id for each seed.
In this example, apple_id_s is coming back as null.
I found the problem. I need to use commonField="true" and make sure to loop through each apple and core. Also, I need to set the pk="seed_s" which triggers solr to store the document.
Here's my new entity definition:
<entity name="apples"
processor="XPathEntityProcessor"
stream="true"
pk="seed_s"
forEach="/fruit/apple/core/seed | /fruit/apple | /fruit/apple/core"
url="fruit.xml"
transformer="script:create_id"
>
<field column="seed_s" xpath="/fruit/apple/core/seed" />
<field column="apple_id_s" xpath="/fruit/apple/#appleId" commonField="true"/>
<field column="core_id_s" xpath="/fruit/apple/core/#coreId" commonField="true"/>

Resources