Grouping by Comma in new column using DAX Only
Hi,
If I have a table like this,
column1, column2
A | apple
A | Orange
B | banana
C | Staple
B | Pencil
How do I group it like this in power pivot,
Column1 | Column2,Column3
A | apple |
apple, orange
A | Orange |
apple, orange
B | banana |
banana, pencil
C | Staple |
Staple
B | Pencil |
banana, pencil
Thanks,
Thanks Avichal,
I was looking for something like the power query solution but in Power Pivot (since some of the data connections I use are odbc and they don't work in power query).
Here's the data that I'm working with
Table 1
Product | Received Date | Received Qty
A | 01/02/2014 | 4500
B | 01/02/2014 | 3500
C | 01/03/2014 | 400
D | 01/04/2014 | 47
A | 01/05/2014 | 350
D | 01/06/2014 | 200
C | 01/07/2014 | 150
E | 01/08/2014 | 20
B | 01/09/2014 | 430
A | 01/09/2014 | 330
*** millions of rows***
Final report that I wanted to create is,
Product | Receive dates(Measure) | Total Received(Measure)
A | 01/02/2014, 01/05/2014, 01/09/2014 | 5,180
B | 01/02/2014, 01/09/2014 | 4,930
I'm trying to figure out how I can combine the dates like this in Receive dates measure, I also want this to be dynamic, so I I filter the dates Slicer to certain dates say may 2014, it only shows the Receive dates in may 2014.
It may be too complicated but my ultimate goal is to make it like this
Product | Receive dates : Receive qty(Measure) | Total Received(Measure)
A | 01/02/2014: 4500, 01/05/2014: 350, 01/09/2014 : 330 | 5,180
B | 01/02/2014: 3500 , 01/09/2014: 430 | 4,930
Let me know if this possible,
Similar Messages
-
New Columns Used in a Package Declaration
I added the following new columns to a table:
alter table J48PLTEQUIP add
LOCBYUSER Char ( 1) Default 'N', UPF85 VarChar2(6) Default To_Char(SysDate,'MMDDRR'),
COFFSETDV VarChar2( 8) , UPF86 VarChar2(6) Default To_Char(SysDate,'MMDDRR'),
COFFSETEV VarChar2( 8) , UPF87 VarChar2(6) Default To_Char(SysDate,'MMDDRR'),
COFFSETEU VarChar2( 8) , UPF88 VarChar2(6) Default To_Char(SysDate,'MMDDRR'),
ROFFSETDV VarChar2( 8) , UPF89 VarChar2(6) Default To_Char(SysDate,'MMDDRR'),
ROFFSETEV VarChar2( 8) , UPF90 VarChar2(6) Default To_Char(SysDate,'MMDDRR'),
ROFFSETEU VarChar2(15) , UPF91 VarChar2(6) Default To_Char(SysDate,'MMDDRR')
Then I tried adding the new columns to a package declaration (see code below) and for some reason I am getting some errors when I compile it:
TYPE tab_coloffsetdv IS TABLE OF J48PLTEQUIP.COLOFFSETDV%TYPE index by binary_integer;
TYPE tab_coloffsetev IS TABLE OF J48PLTEQUIP.COLOFFSETEV%TYPE index by binary_integer;
TYPE tab_coloffseteu IS TABLE OF J48PLTEQUIP.COLOFFSETEU%TYPE index by binary_integer;
TYPE tab_coloffsetdir IS TABLE OF J48PLTEQUIP.COLOFFSETDIR%TYPE index by binary_integer;
TYPE tab_rowoffsetdv IS TABLE OF J48PLTEQUIP.ROWOFFSETDV%TYPE index by binary_integer;
TYPE tab_rowoffsetev IS TABLE OF J48PLTEQUIP.ROWOFFSETEV%TYPE index by binary_integer;
TYPE tab_rowoffseteu IS TABLE OF J48PLTEQUIP.ROWOFFSETEU%TYPE index by binary_integer;
TYPE tab_rowoffsetdir IS TABLE OF J48PLTEQUIP.ROWOFFSETDIR%TYPE index by binary_integer;
SQL> show error
Errors for PACKAGE PWRADMIN.PLAKCOMP:
LINE/COL ERROR
78/4 PL/SQL: Declaration ignored
78/47 PLS-00302: component 'COFFSETDV' must be declared
79/4 PL/SQL: Declaration ignored
79/47 PLS-00302: component 'COFFSETEV' must be declared
80/4 PL/SQL: Declaration ignored
80/47 PLS-00302: component 'COFFSETEU' must be declared
81/4 PL/SQL: Declaration ignored
81/48 PLS-00302: component 'COFFSETDIR' must be declared
82/4 PL/SQL: Declaration ignored
82/47 PLS-00302: component 'ROFFSETDV' must be declared
83/4 PL/SQL: Declaration ignored
LINE/COL ERROR
83/47 PLS-00302: component 'ROFFSETEV' must be declared
84/4 PL/SQL: Declaration ignored
84/47 PLS-00302: component 'ROFFSETEU' must be declared
85/4 PL/SQL: Declaration ignored
85/48 PLS-00302: component 'ROFFSETDIR' must be declared
359/4 PL/SQL: Declaration ignored
362/52 PLS-00302: component 'COFFSETDV' must be declared
Do you have any clues why I am getting this error?
Your help is really appreciated.
AlexTodd, thanks for your prompt answer.
I apologize, I pasted the wrong segment of the code. The TYPE statements should have been the following:
TYPE tab_coffsetdv IS TABLE OF J48PLTEQUIP.COFFSETDV%TYPE index by binary_integer;
TYPE tab_coffsetev IS TABLE OF J48PLTEQUIP.COFFSETEV%TYPE index by binary_integer;
TYPE tab_coffseteu IS TABLE OF J48PLTEQUIP.COFFSETEU%TYPE index by binary_integer;
TYPE tab_coffsetdir IS TABLE OF J48PLTEQUIP.COFFSETDIR%TYPE index by binary_integer;
TYPE tab_roffsetdv IS TABLE OF J48PLTEQUIP.ROFFSETDV%TYPE index by binary_integer;
TYPE tab_roffsetev IS TABLE OF J48PLTEQUIP.ROFFSETEV%TYPE index by binary_integer;
TYPE tab_roffseteu IS TABLE OF J48PLTEQUIP.ROFFSETEU%TYPE index by binary_integer;
TYPE tab_roffsetdir IS TABLE OF J48PLTEQUIP.ROFFSETDIR%TYPE index by binary_integer;
Hopefully, this will clear things out. I am still out of luck with this issue. Thanks in advance again to all the gurus for your help... -
Open bookmark in a new tab using mouse only - how?
Is there a way you can open a bookmarked page in a new tab using your mouse only? Like pressing the middle mouse button in FireFox. I don't like using an extra button on the keyboard to do this, or opening a new, empty tab first and then clicking on a bookmark.
okay, now this thread can die once again
LOL
you can right-click (open in new tab) on bookmarks in your collections page, even those in folders. just can't do this from the bookmarks bar.
Yes, you're right, you can. (And you can Command-click to immediately open in a new tab - quicker and easier than right-clicking and then choosing a menu item, in my opinion.) I thought of mentioning that earlier, but it was clear to me that Rosalba is looking for a way to open a bookmark in the Bookmarks Menu in a new tab without any additional steps, whether opening the bookmarks collection in a new window first, opening a new tab first, etc.
Regardless, we have at least gone over what you can do in this thread. -
How to find the maximum of group sums within a specific column using report builder 3.0
Hi
For each part number I am trying to find out in which week of a month did the largest daily shipment occur... so using report builder 3.0
in SSRS 2012 I can find daily, weekly and monthly totals for the units shipped but I am having a hard time thinking through the logic to find the daily max for each week.
in my data I can have multiple orders/shipments for the same product on the same day.
The ultimate goal is to set inventory levels
So..
In my matrix report I have
Row groups:
Classid => Product class
InvtID => Item Part Number
Column Groups:
FiscYr=> Fiscal Year
PerPost => Month or period the transaction occurred
Week_period => the week the transaction occurred
Day_period => The day that the transaction occurred
The aggregations are
Sum(case_shipped)
Max(case_shipped)
The Sum(case_shipped) is working as desired but the Max(case_shipped) is picking out the max amount shipped on any one order when looking
at the week, month or fiscal period and that is not what I need.
I have attached a screenshot since a picture is worth more than my words. I have also included some sample data
I would very much appreciate any thoughts on this. I am guessing that the solution has something to do with using the inscope function but
I can't wrap my head around how to use it
Thank you
Tom D
Here is some sample data for Product A
Invtid Case_ship Trandate FiscYr PerPost week_period day_period
A 10 1/1/2104 2014 1
1 1
A 3 1/1/2014 2014 1
1 1
A 50 1/2/2104 2014 1
1 2
A 30 1/3/2014 2014 1
1 3
A 20 1/9/2104 2014 1
2 2
A 5 1/9/2104 2014 1
2 2
A 20 1/10/2014 2014 1
2 3
A 60 1/10/2104 2014 1
2 3
On 1/1/2104 I shipped a total of 13 cases
On 1/2/2104 I shipped a total of 50 cases
On 1/3/2104 I shipped a total of 30 cases
On 1/9/2014 I shipped a total of 30 cases
On 1/10/2014 I shipped a total of 80 cases
On 1/9 I shipped a total of 25 cases
I would like to show that in week 1 the maximum number of cases shipped on any day is 50 (1/2/2014)
I would like to show that in week 2 the maximum number of cases shipped on any day is 80 (1/10/2104)
I would also like to show that in perpost (month) 1 the maximum
number of cases shipped on any day is 80 (1/10/2104)Hi
I was able to find a solution
I built a new dataset in report builder using the same table as before but tried out the "Group and Aggregate" function and for the case_ship
field I chose "Sum" as my aggregate.... In essence this gave me a very cool and easy daliy sum of the shipped cases.
When I used this new dataset and built my matrix report I was able to easily get the max daily shipment for each product by week, month and
year.
Tom -
Can no longer create a new account using Exchange, only POP or IMAP?
Using the latest system update (10.5.7) I can no longer create new Exchange accounts in Mail. I have one in my list, but when editing it it shows up looking similar to an IMAP account. Is this a local problem in my installation, or did Apple remove Exchange support?
Mail still supports Exchange.
-
If then Else using DAX Calculation
Hi all, new to DAX. I am trying to replicate a Oracle SQL column using DAX functions in SSAS Tabular.
My Oracle column is defined like below:
If STATE_CODE Not in('A','B','C','D')
And Not (substr(PK_ID,4,2) = 'XY' And DIV_CODE in('YU','SD')) Then
CNT = 1;
Else
CNT = 0;
Any ideas how to start? Should i use DAX Switch function ?
Thanks,
TAGWe have IF and Switch Function Available in DAX .
You can use any of one.
IF(logical_test>,<value_if_true>, value_if_false)
For Switch you can use below;
SWITCH(TRUE(),
booleanexpression1, result1,
booleanexpression2, result2,
else
Just create calculated column in Cube and add this logical IF/Switch function there.
Or If you want to calculate this at query level using DAX then you can follow below Query.
Evaluate
ADDCOLUMNS
TableName,
, "calculated column"
,IF( Logical,Truecondition,False Condition)
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com -
Start new column at group change?
My report is 2 columns. I used the following steps: Section expert>Details>Format with multiple columns; and then on the Layout Tab i checked Format Groups with Multiple Columns. Also, under the "Change Group Options" box and the "Options" tab, I have checked "Keep Group Together" and "Repeat Group Header on Each Page."
I need to get a new column to start with a change in Group #1, and I can't figure that out. There is an option for "New Page After [1] visible group" and that's close, but I need to have *a new column* after one visible group.
My report contains details per US State. I need to not have one page per state, but one column per state.
Any ideas?
Many thanks,
LaraWill it work if you use Cross-Tab instead of Multiple columns for sections?
-
New column add in supplemental log group
Hi All,
How to add the new column in existing supplemental log group.
Ex.
SQL> desc scott.emp
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
And the existing supplemental group is
Alter table emp add supplemental log group emp_log_grp (empno,ename,sal) always;
Now I want to add comm column in log group.
Pls. help.
Thanks
Nareshdid you try..
ALTER TABLE hr.departments ADD SUPPLEMENTAL LOG GROUP log_group_dep_pk
(comm) ALWAYS; -
Adding new column in an existing report which was build using Union
While working in OBIEE 11g I encounter an issue.
My existing report was build using UNION at Criteria Tab in Analysis. Now I have a requirement to add a new column into the same report. For each criteria I have added the new column but when I go back to the "Result Columns". I see a new field added but it is not allowing me to open or edit column properties for that new column & at the same time it is not allowing me to navigate to other tabs like Results, Promts, and Advanced.
I don’t want to build this report from scratch. Is there any workaround to get it resolved?Hi,
Just check it once the new added column data types are mismatched or not?
and the new added column should be navigated into excluded section, so u should edit the report and dragged into the table column section.
Thanks.. -
How to identify the SQLs which are using the tables and new columns
Hi
I m using oracle 10G Database in windows. Developers have added some columns in some of the database tables and were asking to check whether there is some impact on performance or not. I have not done this performance tuning before. Kindly help me how to proceed further.
How to obtain the sqls which are touching the tables and the new columns? It would be really great if you can help me with this.
ThanksYou can try to use DBA_DEPENDENCIES to get PL/SQL objects using tables: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1041.htm#i1576452.
However if SQL code is not stored in database in a trigger, a procedure, a function, a package or a view, it is impossible to retrieve all SQL code referencing some table from database dictionary: for this you would have to analyze application source code. -
I use Function Sum to add a column and a new column pops up filled with 0s
In one of my spreadsheets, every time I try to add a column of numbers using the Sum Function, a new column is added filled with 0s. What's happening? And How do I get it to just add the column?
can't you just write an SQL script to update the new column?
Perhaps you can use the integration_id for this? or just another column(s).. -
FBL1N & FBL3N affected when using BTE to add new column in FBL5N
Hi,
I have a requirement to add a new column External Financial document number (AKKB-BAANR) in tcode FBL5N. And I used BTE ( Business transaction event) to enhance the standard program.
In order to add the new column, I append new structure in 3 structures: RFPOS, RFPOSX & RFOSXEXT. Normally we just append new structures in 2 structure RFPOS & RPOSX and run the program RFPOSXEXTEND, but I got error when running this program, so I just appended directly new structure in structure RFPOSXEXT.
Now FBL5N is running with new added column, but the problem is that other tcodes like FBL1N & FBL3N are also affected with a new column. That's because all 3 code FBL1N, FBL3N & FBL5N are using the structure RFPOS.
Can you give me a suggestion on this issue? Are there any ways of configuration to "turn off" the new column in those tcodes FBL1N & FBL3N ?
Thank you.Hi Madhu,
Thanks for your reply. But currently the new added column are "hidden" from users, i.e, it is saved in another layout. Therefore I don't have to create another layout. I just want to make the new column disppear in the layout option also.
Thank you. -
How to Splilit The String Into Single Column using Comma As Delimiter ?
How to Splilit The String Into Single Column using Comma As Delimiter ?
using Functionrefer my thread ,code is also available see if that helps you
error while executing the sp ORA-21779: duration not active -
Using arrow keys to add new columns to text frames
Is dragging a text box or the mouse as you push the arrow keys to add new columns or rows, specific to CS5? Does this only work for MAC or is it also good for PC?
CS5 or CS5.5, either platform.
-
Increment a new Column in a Blog List using Worlflow
I would like to first say that I need specific instruction, as I do not know how to accomplish this. I know how to create a simple workflow, but having it to do what I describe below is beyond my current ability. I hope someone
can help.
The Scenario:
Blog list Sorted by the Modified date.
The users want the most recent post (including Comments) at the top of the list.
When a user adds a Comment to the Blog Site, the Modified date does not update (since both lists are separate.)
Partial Solution:
I created a new Column in the Blog list called Comment Increment.
My Goal:
I would like to write a workflow that will increase the Comment Increment by 1 each time a Comment is added, thus, updating the Modified date on the Blog post.
Thanks for any help.OK, so this does not work either norasampang.
The issue still remains that the POSTS and COMMENTS lists are separate. They each have a MODIFIED column. I can sort them independently of each other by the MODIFIED column, but on the main Blog site, if a comment is added to a post, it does
not move to the top of the BLOG list, which is essentially a Web Part.
Maybe one day I'll find a solution. I have been unable to find anyone to see me through to a solution.
Thanks for trying norasampang.
Maybe you are looking for
-
Java and Ms access conection and modification
Hello everyone, I have two problems: 1. I need to create tool that will create a test database and later on to populate it. The first problem is connected with creating the file. I do not know whether this is possible or not, but I want to create a f
-
Cannot install Firefox extension for Contribute 4
I'm trying out Contribute 4 and right away during installation there's a bomb: The installer tells me: Unavailable Components These components cannot be installed on your systemat the current time Contribute Extension for Mozilla Firefox Version Requ
-
Set credentials in OMS on Oracle 9i
I installed Oracle Management Server ( in Oracle 9i on Linux ) I started "oemapp console" and I loged to OMS ( user=sysman .....) When I connected to database ( username=sys as sysdba ......), I clicked on label "Save on Preferred Credential". I chec
-
JDBC Persistence Store: How to
I need to create a JMS JDBC Store in WLS9.1 which will enable me to store XML SOAP messages in SQL Server table. At the moment I intend to persist the messages as is into the JDBC store. I thinking of having the DBA to create a table with single attr
-
Does a 2012 DC generate exchange certificates on Exchange 2007 server?
The reason I ask is because we have a 2008 server environment with a few 2012 servers in the mix, one being a DC. It is time to renew our self-signed certificates on our exchange server and when I attempt to do this via the Get-ExchangeCertificate c