Date Sort inside For Each
Hi I am trying to date sort inside for each but it is not working i am using below code
<?for-each:G_3?><?sort:BEG_DT;'ascending';data-type='text'?>BEG_DT END_DT <?end for-each?>
Can any one please let me know how to solve this?
Thanks in Advance
Have a nIce Day.
depends on the format you have in the BEG_DT, if its not in YYYY-MM-DD, you may see some different order.
All sorting works well if you use the date in canonical format.
if you want to force to code., then do this.
<?sort:concat(substring(BEG_DT,7,4),substring(BEG_DT,1,2),substring(BEG_DT,4,2),'0');'descending';data-type='number'?>
Similar Messages
-
Which table include duration&data records number for each nodes in PC?
Hi Experts,
Now I am on Process Chains maintenance work, I need daily record a very huge infopackage process chain's each nodes more then 50 infopackage, record something like duration ,data records nubmer for each infopackage. I need check this one by one in process chain, and my question is do you know this infomation record in which table in BW system? if i know it I will write a program to get it in one time.
Thanks in advance!Hi,
You can find the information about the process[as you said nodes] in his tables ,
RSPCPROCESSLOG - Stores complete information about the finished process
RSPCPROCESSINSTANCE - Stores the meta data for the successor process..it also has the runtime
RSPCVARIANT and RSPCVARIANTATTR - the succesor process reacts to the event
Process chain related tables are start with RSPC*.
under Settings ® Maintain Process Types (table RSPROCESSTYPES).
Pls chk this link;
http://help.sap.com/saphelp_nw04/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
Other tables used for Process chains:
http://wiki.sdn.sap.com/wiki/display/BI/ProcessChainTables
Thanks
Hemav
Edited by: hemav on Aug 4, 2010 7:38 AM -
Custom sorting within "for-each-group:current-group"
Hi, I need some help in doing a custom sort within a "for-each-group:current-group". My formatting is in a table format but I'm not sure how to post a table here so I'm just arranging the column details out as it would look in a table. I have a column on the left for the YEAR and a second column on the right for the DESCR. Under the DESCR column I've inserted a nested table with four columns: SUBJECT, CATALOG_NBR, DESCR250 and GRADE.
COLUMN 1:
<?for-each-group:row_table;./ YEAR?><?sort: YEAR;'ascending';data-type='text'?><?YEAR?>
COLUMN 2:
<?for-each-group:current-group();./DESCR?><?DESCR?>
NESTED TABLE (with 4 columns):
+<?for-each:current-group()?><?SUBJECT?><?CATALOG_NBR?><?DESCR250?><?GRADE?><?end for-each?>+
<?end for-each-group?> <?end for-each-group?>
I'm able to sort by YEAR in the "for-each-group" on the left column. But I also want to do a custom sort on DESCR in the right column.
I've seen this blog on custom sorting by Vetriselvan: http://winrichman.blogspot.com/2009/09/custom-dynamic-sort-in-bi-publisher.html and I tried inserting this sort below after <?for-each-group:current-group();./DESCR?> but I get an error message.
<?sort:(number(DESCR='Status')*1)+(number(DESCR='First Semester')*2)+(number(DESCR='Second Semester')*3);'ascending';data-type='number'?>
I've also seen this thread: Re: Sort within group and tried inserting <?for-each:DESCR?> before the sort (as below) - this time I can preview the results, but it is not sorting as required.
<?for-each:DESCR?><?sort:(number(DESCR='Status')*1)+(number(DESCR='First Semester')*2)+(number(DESCR='Second Semester')*3);'ascending';data-type='number'?>
Can anyone help me custom sort the DESCR column? I'm using Template Builder for Word version 5.6 build 45. Thanks in advance for any help!Hi Vetsrini,
I tried adding <?sort: ./DESCR;'ascending';data-type='text'?> after <?for-each-group:current-group();./DESCR?> but I'm getting an error message.
The DESCR values are below and I'm trying to sort them in the following order.
STATUS
SUMMER SEMESTER
FIRST SEMESTER
AUTUMN SEMESTER
WINTER SEMESTER
SECOND SEMESTER
SPRING SEMESTER
Because I need them in the above order, I can't use ascending or descending, and instead need to use a custom sort order. Do you know how I can go about creating a custom sort order?
Thanks! -
GROUP BY - Is there a way to have some sort of for-each statement?
Hi there,
This discussion is a branch from https://forums.oracle.com/thread/2614679
I data mart I created for a chain of theatres. The fact table contain information about ticket sales, and I have a some dimensions including DimClient and DimTime.
Here is an example of each table:
FactTicketPurchase
TICKETPURCHASEID
CLIENTID
PRODUCTIONID
THEATREID
TIMEID
TROWID
SUMTOTALAMOUNT
60006
2527
66
21
942
40
7
60007
2527
72
21
988
36
6
60008
2527
74
21
1001
40
6
60009
2527
76
21
1015
37
6
60010
2527
79
21
1037
39
6
DDL for FactTicketPurchase
CREATE TABLE FactTicketPurchase(
TicketPurchaseID NUMBER(10) PRIMARY KEY,
ClientID NUMBER(5) CONSTRAINT fk_client REFERENCES DimClient,
-- ProductionID NUMBER(5) CONSTRAINT fk_prod REFERENCES DimProduction,
-- TheatreID NUMBER(5) CONSTRAINT fk_theatre REFERENCES DimTheatre,
TimeID NUMBER(6) CONSTRAINT fk_time REFERENCES DimTime,
-- TRowID NUMBER(5) CONSTRAINT fk_trow REFERENCES DimTRow,
SumTotalAmount NUMBER(22) NOT NULL);
DimClient
CLIENTID
CLIENT#
NAME
TOWN
COUNTY
2503
1
LEE M1
West Bridgford
Nottingham
2504
2
HELEN W2
Hyson Green
Nottingham
2505
3
LEE M3
Lenton Abbey
Nottingham
2506
4
LORA W4
Beeston
Nottingham
2507
5
SCOTT M5
Radford
Nottingham
2508
6
MINA W6
Hyson Green
Nottingham
..cff.
DDL for DimClient
CREATE TABLE DimClient(
ClientID NUMBER(5) PRIMARY KEY,
Name VARCHAR2(30) NOT NULL);
DimTime
TIMEID
FULLDATE
YEAR
SEASON
MONTH
MONTHDAY
WEEK
WEEKDAY
817
02-MAR-10
2010
Spring
3
2
9
3
818
03-MAR-10
2010
Spring
3
3
9
4
819
04-MAR-10
2010
Spring
3
4
9
5
820
05-MAR-10
2010
Spring
3
5
9
6
821
06-MAR-10
2010
Spring
3
6
9
7
822
07-MAR-10
2010
Spring
3
7
9
1
DDL for DimTime
CREATE TABLE DimTime(
TimeID NUMBER(6) PRIMARY KEY,
Year NUMBER(4) NOT NULL,
Season VARCHAR2(20));
I have the following analysis request to perform on this data mart:
Top 5 clients by value of ticket sale for each season
For this requirement I came up with the following query:
SELECT * FROM
(SELECT FacTIC.ClientID, DimCLI.Name, SUM(SumtotalAmount) SumTotalAmount, DimTIM.Season
FROM FactTicketPurchase FacTIC, DimClient DimCLI, DimTime DimTIM
WHERE FacTIC.ClientID = DimCLI.ClientID
AND FacTIC.TimeID = DimTIM.TimeID
AND Season = 'Spring' AND Year = 2010
GROUP BY Season, FacTIC.ClientID, DimCLI.Name
ORDER BY Season ASC, SumTotalAmount DESC)
WHERE rownum <=5;
As you can see, in line 06 of the above query, I am explicitly specifying the season for the query to return.
However what I would like to do is just one query that could autocratically go through the seasons and years available in the time dimension in a fashion similar to a FOR-EACH statement. This way, if we get more years added to the time dimension, we wouldn't have to amend the query.
Is this possible?
Regards,
P.I think I fixed it!
The trick was to look into the r_num value. As soon as I added it to my query I started to see how r_num was being calculated and I realised that I had to add Season to my partition, right after Year.
SELECT Year, Season, TotalAmount, Name
FROM (
SELECT DimCLI.Name
, DimTIM.Year
, DIMTIM.Season
, SUM(FacTIC.SumTotalAmount) TotalAmount
, RANK() OVER (PARTITION BY Year, Season
ORDER BY SUM(FacTIC.SumTotalAmount) DESC
) AS r_num
FROM FactTicketPurchase FacTIC
, DimClient DimCLI
, DimTime DimTIM
WHERE FacTIC.ClientID = DimCLI.ClientID
AND FacTIC.TimeID = DimTIM.TimeID
GROUP BY DimTIM.Year
, DimTIM.Season
, DimCLI.Name
WHERE r_num <= 5 -- Need to amend this line on my data sample to show 2 rows.
ORDER BY Year, Season, TotalAmount DESC;
Looking at my data sample, I got the following:
YEAR
SEASON
TOTALAMOUNT
CLIENTID
2010
Autumn
29
2504
2010
Autumn
26
2503
2010
Spring
25
2503
2010
Spring
14
2506
2010
Summer
26
2506
2010
Summer
26
2504
2010
Winter
28
2503
2010
Winter
26
2506
2011
Autumn
23
2506
2011
Autumn
14
2503
2011
Spring
25
2505
2011
Spring
13
2503
2011
Summer
21
2505
2011
Summer
14
2503
2011
Winter
19
2505
Now, looking at my real data, (considering the top 5 rows, not the top 2), I got:
YEAR
SEASON
TOTALAMOUNT
NAME
2010
Autumn
141
BUSH M225
2010
Autumn
140
DIANA W66
2010
Autumn
136
HANA W232
2010
Autumn
120
DIANA W220
2010
Autumn
120
WILSON M459
2010
Spring
137
DAVID M469
2010
Spring
125
ALEX M125
2010
Spring
124
PETER M269
2010
Spring
115
ZHOU M463
2010
Spring
114
TANIA W304
2010
Summer
138
JANE W404
2010
Summer
105
MINA W8
2010
Summer
97
DAVID M275
2010
Summer
96
CLINTON M483
2010
Summer
93
ANNA W288
2011
Spring
12
LUISE W20
2011
Spring
7
ANNA W432
2011
Spring
7
LEE M409
2011
Spring
7
CHRIS W274
2011
Spring
7
HELEN W136
2011
Spring
7
LILY W114
2011
Spring
7
LUISE W348
2011
Spring
7
LIU M107
2011
Spring
7
VICTORY W194
2011
Spring
7
DIANA W240
2011
Spring
7
HELEN W120
2011
Spring
7
LILY W296
2011
Spring
7
MATTHEW M389
2011
Spring
7
PACO M343
2011
Spring
7
YANG M411
2011
Spring
7
ERIC M101
2011
Spring
7
ALEX M181
2011
Spring
7
SMITH M289
2011
Spring
7
DIANA W360
2011
Spring
7
MATTHEW M63
2011
Spring
7
SALLY W170
2011
Spring
7
JENNY W258
2011
Spring
7 -
hi,
I gave one for-each loop inside one row, the table which am using has three columns and two rows, at first row there are column headings and second row first column i started for-each loop and ended end for-each loop at third column. Now I am getting displayed multpile rows for each occurence of elements that is fine but How can I get rid of lines which is occuring between each rows. Is there any way to deal this.
Thanks :)send me you template and xml to my id in profile.
-
Hi,
i have come across a requirement where i need to place a table of content inside a conditional loop. Basically, requirement is to get ToC for each opportunity in an XML.
At the moment, i tried inserting the TOC using MS Word features but the output PDF/RTF is not rendering the table of contents. It is coming blank.
The TOC is only rendered if it is placed outside the BIP code.
is there any workaround for this, where i can place an MS WORD TOC inside BIP code.
Many thanks
RohitHy all,
I've the same problem with TBW : putting a toc in a for each loop doesnt render in pdf output. It works outside loop but not inside. Any solution since las t post on subject ?
Regards -
Pls help : How To select fields and data from user_table for each tablename
Please help with the query to generate a output which selects the code,meaning,inuse for each table in the user_table that has "CODED" as a part of table name.
User table has some 800 table that contains CODED in the tablename.
Desc of the table:
DESCPTION:
Name Null? Type
SHORT_NAME NOT NULL VARCHAR2(20)
CODE NOT NULL VARCHAR2(4)
MEANING NOT NULL VARCHAR2(240)
IN_USE VARCHAR2(1)
NOTES VARCHAR2(2000
UNITS NOT NULL VARCHAR2(1)
AMOUNT NOT NULL VARCHAR2(3)
CONVERTED VARCHAR2(1)
RUN_NAME VARCHAR2(30)
But all the table have code, meaning,in_use fields.
O/P format :
TABLE_NAME CODE MEANING IN_USE
Help me pls.Not 100% sure what you want. If you want to see all the tables that have all three of those columns, then you could do something like:
SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
FROM user_tab_columns
WHERE column_name = 'CODE' and
table_name like '%CODED%'
INTERSECT
SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
FROM user_tab_columns
WHERE column_name = 'MEANING' and
table_name like '%CODED%'
INTERSECT
SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
FROM user_tab_columns
WHERE column_name = 'INUSE' and
table_name like '%CODED%'If you want to select those three columns from each of the tables, then you could do something like this.
Create a command file called, for example, makesel.sql that looks like:
SET PAGES 0 lines 500 trimspool on feedback off;
spool sel.sql;
prompt spool selout.txt;
SELECT 'SELECT '''||table_name||''', code, meaning, in_use FROM '||
table_name||';'
FROM (SELECT table_name
FROM user_tab_columns
WHERE column_name = 'CODE' and
table_name like '%CODED%'
INTERSECT
SELECT table_name
FROM user_tab_columns
WHERE column_name = 'MEANING' and
table_name like '%CODED%'
INTERSECT
SELECT table_name
FROM user_tab_columns
WHERE column_name = 'INUSE' and
table_name like '%CODED%')
prompt 'spool off;'
spool off;
@sel.sqlAt the sqlplus prompt run the file using @makesel.sql. This will create another file called sel.sql containing the commands to select those three columns from each table that has all three columns, then after the new file is created, it runs the file (@sel.sql). The output will be spooled to a file called selout.txt.
HTH
John -
Displaying data in chart for each iteration of FOR loop
Hi Flex experts,
I'm coding an Actionscript routine that has a series of
complex calculations within a for loop. I would like to display
some of the calculation results in a Flex chart at the end of each
iteration of the loop. Thus far, I can only get the chart to
display the results from the last iteration, but not any of the
preceding iterations.
Any tips or pointers would be greatly appreciated.
Thanks,
DeanPlease have look at callLater method. You can call your
chart-updating method thru callLater and that might help.
Otherwise, can you share some of your code in the loop?
ATTA -
SSIS Help For each Loop Container
I need a little help with this process that I am developing. I am fairly new to SSIS so please bear with me. I have done research online so If I seem limited in my knowledge please apologize me.
Requirement: I have a folder where we will have flat files monthly they could be one or more...
each file will have the following name standard "123456.EEAKQ2.EASDREWA12A.BID".
What I need to do is maintain a table which will have filename and date when it was added to the folder.
I have created a package with the following components "For each loop" which grabs files from a source folder.
This is where I am stuck. I need to grab the file name from the path and insert it into the table.
Can someone help me with this?
Thank you
FM
FMSee similar requirement implemented here
What you need is to declare and use a variable inside for each loop to get filename each time. Then you may use script task to check for pattern within the file for identifying correct files
http://visakhm.blogspot.in/2012/05/package-to-implement-daily-processing.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Default Sort Order for Library View
It would be fantastic if there were a user defined preference for a default sort order in Library view. For example, some users may prefer to always view the images by File Name, or Rating, etc, without having to change the sort order for each individual folder they view via Lightroom.
Thanks!Thanks for your suggestion Allan, but it doesn't work.
I'm specifically referring to the defaults that Aperture 3 adopts when you use the "File, Import, Folders as Projects with the projects and albums setting.
What I'm finding is regardless of the setting in the Library preferences, the default sort order for the project is Date and Manual for the album.
Yet if I create a project manually the default sort order is as per the Library prefs. Strange. -
How to output data outtside a for loop every 10 iterations​?
Hi friends,
does any body help me to sort out this problem?
please check the attchement for my vi.
all i want is output data from inside for loop to outside for loop every 10 iterations. please do not use local variable.
Many thanks
dan
Attachments:
output.vi 16 KBHi Dan,
I am not sure what you want to do every 10 iterations with the value outside, but If you want to update your graph every 10 iterations use the following way:
If you want to handle the specific value every x iterations outside the loop you could either use queues or notifieres.
BR,
ThSa
Message Edited by ThSa on 08-23-2006 09:05 PM
http://www.newgistics.com
Attachments:
1.png 6 KB -
Limit of for each conditions in rtf templates
Hi Everyone,
I have a use case where i need to genereate a report by using values from two data sets. data sales, cost.
Data set sales have four columns product1, product 2, product 3, product 4
Cost has cost1,cost 2, cost 3, cost 4.
I need to display in below format
product 1| product 2| cost 1|cost 2| product 3| product 4| cost 3| cost 4|
To get above format i am using four for each condition groupings two for each data set
<?for-each:/data/sales?><?product1?>|<?product2?><?end for-each?>|<?for-each:/data/cost?><?cost1?>|<?cost2?><?end for-each?>|<?for_each:/data/sales?><?product3?>|<?product 4?><?end for-each?>|<?for-each:/data/cost?><?cost3?>|<?cost4?><?end for-each?>
If i use first two for each conditions i am able to see values in template but if i use four line is missing in the template.
I did not understand where lies the problem.
Please let me know if you need more info.
Regards
SandeepIf you have product ID or key in the cost data set, then you can follow the method in this post to display data:
http://blogs.oracle.com/xmlpublisher/2009/09/formatting_concatenated_dataso.html -
To view reports in new page for each cutomer using Report Designer
HI all
I have a requirement to view the data (key figures) for each customer in a new page.
I have created the same using the Report Designer tool.
Now there is setting for this Group Header 'Customer' i have selected the option 'repeat group header on each page'
still the query when generated, gives fine results for certain cases but not for all.
like it will show the each customers in a fresh page for some pages , then in midst there would some 2-3 customers in the same page.
There is no relation between these customers , they are same as the other customers, no difference at all.then i am not able to figure out the reason why it is behaving so odd.
Thanks
RameshRamesh,
right now there really is no way to solve what you are looking for. There partial solutions, but you will not be able to force a page break in a dynamic report.
Here is what I have faced, and what I have come up with so far:
I have a series of reports that have the same column heading, but spread over 5 pages in a fixed structure. I need to be able to re-use the header and the general report design with 6 reports. Here is my solution:
1. Create an outline of the report. I did all the formatting by creating a report section for each page. You can force page breaks between the pages. Upgrade to patch 1502 (came out last week) and you will see some new functionality (such as fit to page, page numbers, etc).
2. Insert all you page breaks and do all the formatting.
3. Insert an infoprovider. Once in, you can just drag and drop the key figure cells into your formatted report.
4. Create additional modification for formatting as needed.
This fixes my problem (for now), but I had to do a lot of work to come up with this. Also, the latest patch (1501 and 1502) has created an issue for me - there is a null exception when I try to use a variable or a filter value in the report body - I can't save the report. I have an OSS message out, but our BASIS guys are going to be taking the lead on troubleshooting this.
The reason that you are seeing some customers on the new pages is probably because of "how the cookie falls" - they just fit that way.
I am trying to be positive and overcome the limitations that are in place right now. If my technical issue is solved, I would recommend upgrading to the new patch (1403 is the latest stable one in my opinion)
good luck
Pavel -
SharePoint: Workflow to retrieve all users and Create list item record for each user
Hi all,
My share point site have two Lists as Holidays and MyCalender.
Actually Holiday is simple non-Calender list with field as Holiday Date, Reason. MyCalender List Calender type list with Person Look-up column and user can see his own record. User of Manager group will declare holiday. This Holiday should get reflected
on each user 's MyCalender List.[One listitem as holiday date and reason for each user] so everyone can view that record.
I have requirement as Manager will create one Holiday record and then run single workflow so for all users present in SharePoint Site, one MyCalender List Item record should get created. Is it possible to do using Workflow?? Please help as I didn't get any
solution for this.. Thanks in advance!You don't need one workflow per user when a filtered view can do this for you. If the manager's list is the parent calendar, I'm assuming that he'll be at least using the person look-up column.
Whether this feeds through the MyCalendar or stays where it is, you can use the [Me] parameter within the filter on a new view. This will then return the assigned holiday filtering against the account that is logged in.
Steven Andrews
SharePoint Business Analyst: LiveNation Entertainment
Blog: baron72.wordpress.com
Twitter: Follow @backpackerd00d
My Wiki Articles:
CodePlex Corner Series
Please remember to mark your question as "answered" if this solves (or helps) your problem. -
Regarding count for each type Trace entry
Hi Friends,
I am using ALV grid Display to display the Result.
my requirement is to display report with sorting & Count for each entry on a particular field.
Can anybody give me the idea or smalll code on this Plz...
Thanks in advance.
Regards,
RavishHi,
For sorting you can use standard ALV sorting functionality. (Pass the parameter it_sort by filling the sort field name and sort order like up or down(Either one).
For count you need to keep explicit logic.
Sample code.
SORT i_final BY field1. "Your count field criteria.
LOOP AT i_final INTO wa_final.
ADD 1 TO l_count.
AT END OF field1.
MOVE l_count TO wa_final-count.
MODIFY i_final FROM wa_final WHERE field1 = wa_final-field1 TRANSPORTING count.
CLEAR l_count.
ENDON.
ENDLOOP.
Make sure that your count based field is the first field in itab. For displaying the output you can adjust the fieldcat.
Thanks,
Vinod.
Maybe you are looking for
-
1 Apple ID. Multiple Devices.
I have an Apple ID that I share with both of my sisters because we want to share our iTunes. This was never a problem until we all got iPhones. Now periodically we all get each others texts, calendars, contacts, etc. I am trying to utilize iCloud so
-
How do I move an app from my desktop or system preference or finder onto the background?
Like the question says how do I move an app of mine from my doc or finder onto the main screen of my MBA. I am following the instructions but it is just not happenning.
-
Whenever I try to update or uninstall, I get the following error: An error occurred while installing Adobe AIR. Installation may not be allowed by your administrator. Please contact your administrator. Spoke with IT guy, he doesn't know what that mea
-
How do I get my 'On my iPhone' Contacts to sync to iCloud?
We just upgraded my son's Mac to 10.8.2 from SnowLeapord. He didn't previously have iCloud support. So on his iPhone he had his contacts stored as 'On my iPhone'. He had a separate Contact list on his Mac for his AIM addresses. We turned on iCloud s
-
I was given a 2nd gen Ipod Nano when I bought a guys other iPod. He gave it to me saying it wouldn't turn on so it's not like I got ripped off or anything. I've left it plugged in for hours, tried the reset menu and center thing several times also. A