Column to Row transpose in Talend [closed] - talend

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to get a crosstable operation by using Talend Open studio.
My Source is like:
id 201601 201602 201603 ...
1 aa bb cc ...
I want to get the output like below:
id date value
1 201601 aa
1 201602 bb
1 201603 cc
. . .
. . .
. . .
Column name is depend on date. So I need a automatic way to convert columns into rows.

You may use tSplitRow.
See the capture with the job, tSplitRow configura and schema.

I think you can try with tUnpivotRow component. However you need to know this is custom component created by community member daztop.
Component is avalaible to download from this link.
Under this link you will find instruction how to use this component.
Also if your data are stored in database you can transpose columns to rows direclty in that database by running proper sql query via talend (query depends from databse engine).

Related

Matlab data pull and save [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
What I'm attempting to do is simple:
Given an excel dataset and user defined inputs, open the associated excel file, pull the associated information for the user inputted information and save this information in a separate excel file.
I've already developed a list of values and the program recognizes user input with associated checks. I'm stuck on getting Matlab to use this information to open the correct dataset, I don't know how to get Matlab to pull a row/column in excel with a silent open and I don't know how to get it to save that data into a separate excel file. Any help would be appreciated, thank you.
Consider using the functions readtable, and writetable if you have a recent MATLAB (anything more recent than R2013b). The readtable function will 'silently' read data from a specific worksheet in an Excel file into a MATLAB table variable. From there you can 'query' the table to find the specific rows you want and write the result to a new excel table with writetable.
Using readtable, you can specify the range of data with the parameters sheet and range.
requested_data = readtable(excel_file, ...
'sheet',input_sheet_name, ...
'range',input_data_range);
and write the data to another Excel file with
writetable(requested_data,ouput_excel_file, ...
'sheet',output_sheet_name, ...
'range',output_data_range);
Note: Remember to set the values for excel_file, input_sheet_name, input_data_range, output_excel_file, output_sheet_name, and output_data_range before running above commands.
Querying the table to access data in your table. One way would be to use ismember as in this answer.
Finally, use writetable to store the values.
See also: sheetnames, detectImportOptions, and SpreadsheetImportOptions

adding weekends and excluding working days [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
How can I create a calculated field in Tableau that shows me the following;
it should exclude weekdays working hours between 08:00 am-16:00pm
It should include full weekends.
Trying to find who is login to the system after working hours.
Thanks a lot,
Assuming that you want to flag unauthorised logins, I have done it like that-
Sample data I have used-
Calculated field unauth_login like this
DATEPART('iso-weekday', [Login_time]) >5
OR
DATEPART('hour', [Login_time])>=16
OR
DATEPART('hour', [Login_time])<8
and you will your desired results with yes values flagged separately from no. Screenshot
Do tell me whether I got you correct?
Assumption: Saturday and Sunday are weekends are in your country/locale.

Join two data sets by year in Tableau [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have two datasets which looks like:
# 2013_data.tsv
year state age
2013 CA 22,5
2013 OH 19,3
2013 IL 45,5
2013 TX 33
# 2012_data.tsv
year state age
2012 CA 23
2012 OH 21,5
2012 CA 44,3
2012 TX 34,4
I want to use year as a pager on the Tableau map.
How can I join this separate data sources?
You could blend on year, but if the year is always different in each data source then the blend will not match on anything and you will get no results.
I am guessing that each data source (tsv file) has the same format (same number of columns and column names). In that case you can extract each data source with tableau desktop and then add the data from each source to get a master extract. (you are basically appending the data extracts):
and you will get all the data in one extract:
from here it is simple to combine the years in one visualization.
Also, since this is SO, I will point out that you can do this programatically with the extract API (see https://www.tableau.com/learn/tutorials/on-demand/extract-api-introduction).
Your best approach in this case is to put all the data into one table before using tableau. (It looks like what you really want is a union instead of a join)
Another approach is to put two tables in the same database, or two tabs on the same spreadsheet,and use custom SQL to union all them together. Or you can append multiple tables into a single Tableau extract as emh described.
If you are conceptually joining tables instead of unioning them, you could also use data blending.

Find Last 5 columns of a table [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is there a way to find the values of last 5 columns of a table?
Suppose if i have a table of 20 columns, i want to select all the values from the last 5 columns.
Any help will be appreciated. Thanks in advance.
Don't. It's stupid.
There shouldn't really be any order to the columns - they should just have names. It's just a convenience when testing or sitting at a DB console that SELECT * gives you them all.
There are very few cases where SELECT * makes sense in a live system. I can't think of any where you want whatever columns happen to be "last" on a table.
If you are really committed to doing this then you'll have to query the information-schema or system catalogues. Get a list of the columns on a particular table and then build your SQL to query them.
However, if you aren't in control of this table then it's a meaningless task since you won't know what the information means. If you are in control of the table then you know what column-names there are and that's a better way to do it.
Seems simple enough unless I misunderstood.
Select col16, col17, col18, col19, col20
From yourtable
i got the answer
SELECT column_name
FROM information_schema.columns
WHERE table_name='your_table'
order by ordinal_position
From ordinal_position we can get last 'n' columns we want.
Thanks for all the answers.

Logic issue, adding Buttons to UI based on database entries [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
In my SQLite database (FMDB) i have some attributes as listed below;
Module | Student1 | Student2 | Student3 | Student4 | Student5
One Module may have a minimum of 2 students and a maximum of 5 students. So based on the number of students i have to display Buttons.
If the number of student are 3, then i should display 3 buttons. For Ex : if the database entry is as
Science | jack | Tom | - | Debra | -
note that the - sign is an empty record. So if we come across a entry with - sign we have to ignore it. So according to the above query we have 3 students and we should display 3 buttons. (If there were 4 students we should display 4 buttons and etc...)
How could i read the values from the database, and base on that answer add buttons to the UI ?
note: I don't have any proper code to demonstrate my working. I am lost in this.
Ok, So first learn about interacting with with a SQLite FMDB Here
Then, create some kind of for loop combining the code from here and here to create UIButtons and add them to an array, then displaying only the UIButtons in the array.
The positioning of the buttons onscreen is just a bit of simple math.