WPF Table Multiple Row Header - wpf-controls

How can i achieve this multiple row header in WPF table?
Example:
ID Name Age Gender
City Phone 1
Address 1 Phone 2
Address 2
------------------------------------
1 Justin 30 M
L.A. 1000000
St.Add 1 2000000
St.Add 2
2 Monica 25 F
Salt Lake 5000000
St.Add 8 6000000
St.Add 9
Table is placed in a flow document and which will be shown via WPF Document Viewer. Thank you.

Related

Report two tables that are connected as foreign keys in StimulSoft

I have two data bands in StimulSoft, one of the tables is connected to the first table by a foreign key, Master table is AllTeam looks like this:
id
TeamSubject
Manager
GroupCode
DateCreate
1
Sky
Ali
120
1400/01/01
2
Gold
Saman
111
1401/10/15
3
Mersad
Hamed
220
1400/06/21
The second table is connected to the master table by the foreign key of the 'id' column
TeamMembers looks like this:
id
AllTeamID
Name
Family
MemCode
1
1
saeed
karimi
1234
2
2
ali
hasani
1289
3
2
hamed
akbari
9874
4
3
kazem
sami
7895
6
1
ahmad
barati
121212
9
1
pardis
goli
359642
I want both tables to be displayed in Stimulsoft so that after each row of the master table all the records connected to it from the second table below it are displayed.
Result should be like this
id
TeamSubject
Manager
GroupCode
DateCreate
1
Sky
Ali
120
1400/01/01
id
AllTeamID
Name
Family
MemCode
1
1
saeed
karimi
1234
6
1
ahmad
barati
121212
9
1
pardis
goli
359642
id
TeamSubject
Manager
GroupCode
DateCreate
2
Gold
Saman
111
1401/10/15
id
AllTeamID
Name
Family
MemCode
2
2
ali
hasani
1289
3
2
hamed
akbari
9874
id
TeamSubject
Manager
GroupCode
DateCreate
3
Mersad
Hamed
220
1400/06/21
id
AllTeamID
Name
Family
MemCode
4
3
kazem
sami
7895
My main problem is that how can I introduce the ID field in the first data band, that is, the master table, to the second data band as a variable?

Perform unique row operation after a groupby

I have been stuck to a problem where I have done all the groupby operation and got the resultant dataframe as shown below but the problem came in last operation of calculation of one additional column
Current dataframe:
code industry category count duration
2 Retail Mobile 4 7
3 Retail Tab 2 33
3 Health Mobile 5 103
2 Food TV 1 88
The question: Want an additional column operation which calculates the ratio of count of industry 'retail' for the specific code column entry
for example: code 2 has 2 industry entry retail and food so operation column should have value 4/(4+1) = 0.8 and similarly for code3 as well as shown below
O/P:
code industry category count duration operation
2 Retail Mobile 4 7 0.8
3 Retail Tab 2 33 -
3 Health Mobile 5 103 2/7 = 0.285
2 Food TV 1 88 -
Help on here as well that if I do just groupby I will miss out the information of category and duration also what would be better way to represent the output df there can been multiple industry and operation is limited to just retail
I can't think of a single operation. But the way via a dictionary should work. Oh, and in advance for the other answerers the code to create the example dataframe.
st_l = [[2,'Retail','Mobile', 4, 7],
[3,'Retail', 'Tab', 2, 33],
[3,'Health', 'Mobile', 5, 103],
[2,'Food', 'TV', 1, 88]]
df = pd.DataFrame(st_l, columns=
['code','industry','category','count','duration'])
And now my attempt:
sums = df[['code', 'count']].groupby('code').sum().to_dict()['count']
df['operation'] = df.apply(lambda x: x['count']/sums[x['code']], axis=1)
You can create a new column with the total count of each code using groupby.transform(), and then use loc to find only the rows that have as their industry 'Retail' and perform your division:
df['total_per_code'] = df.groupby(['code'])['count'].transform('sum')
df.loc[df.industry.eq('Retail'), 'operation'] = df['count'].div(df.total_per_code)
df.drop('total_per_code',axis=1,inplace=True)
prints back:
code industry category count duration operation
0 2 Retail Mobile 4 7 0.800000
1 3 Retail Tab 2 33 0.285714
2 3 Health Mobile 5 103 NaN
3 2 Food TV 1 88 NaN

1) Issue In Normalize Transformation for Informatica Power Center

I am Trying to Normalize Records of My SOurce table using Normalize Transformation in informatica, But Sequence are not re-generating for different rows.
Below Is SOurce Table :
Store_Name Sales_Quarter1 Sales_Quarter2 Sales_Quarter3 Sales_Quarter4
DELHI 150 240 455 100
MUMBAI 100 500 350 340
Target Table :
Store_name
Sales
Quarter
I am Using Occurrence - 4, on Sales Column for getting GCID Sales.
For Quarter, I am Using GCID Sales column :
O/P :
STORE_NAME SALES_COLUMN QUARTER
Mumbai 100 1
Mumbai 500 2
Mumbai 350 3
Mumbai 340 4
Delhi 150 5
Delhi 240 6
Delhi 455 7
Delhi 100 8
Why Quarter Value is not restarting from 1 for Delhi and is continuing from 5 ?
There is a GK column that keeps sequential numbers for all rows. Definitely, GCID is the right column that keeps numbers per multi-occurrences in a row. So, double check that there is GCID port and not GK that is linked to QUARTER port to target…
It’s good to provide a screenshot for the mapping and for the normalizer transformation (Normalizer tab) to be more informative about your question/issue…
But I suppose you have 'Store_Name' port at level 1 and all 'Sales_Quarter1', 'Sales_Quarter2', 'Sales_Quarter3' and 'Sales_Quarter4' ports grouped at level 2 on Normalizer tab (using >> button at top left area). And at group level (for these four ports) you set the Occurrence to 4.

excel multiple criteria and transform horizontaly to verticaly

I have unique number of items and invoices, but one invoice can have multiple items.
A B C D
1 Invoice Items
2 1 10
3 2 20
4 1 30
idea is sort it to horizontaly via this formula
=IFERROR(INDEX($B$2:$B$8;SMALL(IF($D$2=$A$2:$A$8;ROW($A$2:$A$8)-ROW($A$2)+1);COLUMN(A1)));"")
result:
A B C D E F
1 Invoice Items Invoice Item1 Item2
2 1 10 1 10 30
3 2 20
4 1 30
But my geal is setup results horizontaly:
A B
1 Invoice Items
2 1 10
3 1 30
4 2 20
Is that even possible ?
Is your goal actually to sort on Invoice first and then on Items? If so, why just not using sort on two levels using the build in option?
Input:
Sort:
Output:
It's in Dutch but you'll get the idea :)

SUMIFS across multiple sheets

So I'm working on a workbook right now that is across 3 sheets, 'Data', 'RAW', 'Lookup'. On the Data tab it looks like, Sheet 1
A B C D E
Segment Ranking Amount Revenue Spend
Carbon 15 2 5000 550
Oxygen 30 3 6895 450
Minerals 45 1 4400 350
The Code I use for each column are as follows (Some of the Columns are named columns)
B =IF(NOT(ISERROR(SEARCH("OK",$A2))),SUMIFS(RAW!B:B,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*"),SUMIFS(RAW!B:B,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*",Output,"<>*OK*"))
C =IF(NOT(ISERROR(SEARCH("OK",$A2))),SUMIFS(RAW!C:C,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*"),SUMIFS(RAW!C:C,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*",SegmentName,"<>*OK*"))
D =IF(NOT(ISERROR(SEARCH("OK",$A2))),SUMIFS(RAW!D:D,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*"),SUMIFS(RAW!D:D,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*",Output,"<>""OK"))
E =IF(NOT(ISERROR(SEARCH("OK",$A2))),SUMIFS(Spend,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*"),SUMIFS(Spend,Output,"*"&INDEX(SegmentID,MATCH($A2,SegmentName,0))&"*",Output,"<>*OK*"))
The RAW Sheet looks like (Sheet 2)
A B C D E
Output Ranking Amount Revenue Spend
Random_1234_Random 15 2 5000 550
Random_5678_Random 30 3 6895 450
Random_9102_Random 45 1 4400 350
Random_555_Random 60 4 4000 300
The Lookup Sheet Looks like (Sheet 3)
A B
Segment ID
Carbon 1234
Oxygen 5678
Minerals 9102
Carbon 555
The problem that I have right now is, it will only grab the first Carbon with ID 1234, and not grab the second Carbon with ID 555 at all resulting in:
A B C D E
Segment Ranking Amount Revenue Spend
Carbon 15 2 5000 550
The end result that I would like is for it to grab ALL Carbon with any ID and add all of them together as below into a single line. (RAW sheet, Random_1234_Random + Random_555_Random)
A B C D E
Segment Ranking Amount Revenue Spend
Carbon 75 6 9000 850
Any help would be great and if I need to provide more detail please let me know!
Thank you in advance,
Maykid

Resources