Date difference based on the conditions is giving wrong values
Hi,
In creating the formula for conditional date difference calculation,
i.e.,
if (sto date is 0) then (act date - mat rel date) else (sto date is not equal to 0) then (sto date - mat rel date)
So I tried with,
(sto date == 0) * (act date - mat rel date) + (sto date <> 0) * (sto date - mat rel date)
But I am getting a wrong value even with decimals as days can't be in decimals. Please suggest where I am going wrong in calculation.
Thanks,
Best Regards,
Darshan MS
Hi Darshan,
First of all, were the dates converted already to keyfigure?
If not, please check:
Convert a Characteristic into a Key Figure (BEx)
If they were already converted, try this:
(sto date == 0) * (act date - mat rel date) + (sto date - mat rel date)
Regards,
Loed
Similar Messages
-
Can we take standard report for all sales orders based on the condition typ
Hi all,
Based on the condition type, we need to take a report for sales orders on the particular date.
Thanks and Regards.....VMHello again.
Searching for a solution, I found a Logical Database for sales orders, that have all the information that you need.
Using like reference the post of Bhagavatula, in the same transaction SQVI you can use, instead of the suggested join, you can select a logical database called VAV in Data source.
This logical database links the tables, VBAK, VBAP, VBUK and KONV that is the central point of the question.
You can list the information of logical database using the transaction SLDB.
In 'Logical Database' inform VAV.
Press F8 to list all the fields.
More information about logical database in:
Link: [SAP Logical Database|http://help.sap.com/saphelp_46C/helpdata/EN/9f/db9b5e35c111d1829f0000e829fbfe/content.htm] -
Oracle Business Intelligence How to choose data set based on a condition
Hi,
I am using Oracle Business Intelligence for creating reports, i am facing a situation where i have two quries (data sets in BI), one to display a Failure message and other to fetch data from the table to be displayed in the report.
The problem is i am unable to choose which data set to run based on a condition. How to use a condition based on which the dataset will be run
For example : i will read a table column value if it is 'S' means success, then i have to run the dataset to fetch the data from the table.
If the column value has 'F' then i have to run the dataset which will display failure message
Please let me know if any of you have any idea on this
Thanks in advance
MuthukumaranHi Chinna,
You have to use some scripting as well as coding to perform the tasks listed by you. First of all make your form Dynamic, In your Adobe lifecycle Designer, open your form,
Goto, File --> Form Properties,
Goto the Defaults tab,
Select "Dynamic PDF" for the XDP Preview Format:
Click OK.
This setting will now allow dynamicity in your Form, when you view it in PDF Preview tab.
For Hiding/Unhiding the fields/SF, you can use the presence property and set it based on the conditions. like:
if (this.rawValue == null)
TextField1.presence = "hidden";
For your second task, you may map a method corresponding to onSubmit event of the IF and write the code to create the workflow and make RFC call here.
For third one, you need to convert the PDFObject from Binary context into a byte array and save it at appropriate location.
Hope I have answered all your queries.
Cheers,
Arafat -
Inserting new columns based on the condition!
Hi guys,
I have a very simple query like the following…
SELECT table2.column_code2,
table2.column_description2,
table2.column_code1,
table1.column_description1
FROM database_001.table2 table1 LFET OUTER JOIN database_001.table2 table1 on (table2.column_code1 = table1.column_code1)
From this query, its returning me a result set of something like below:
column_code1 column_description1 column_code2 column_description2
RO1 BOOK RL1
PDF/ECOPY
RO2 PAPER RL2
CONFERENCE
RO5 JOURNAL
RL11 OTHER
Now, on the above query I want to insert three extra columns with the name (status, location and contact) where the results in the extra three columns would be based on the conditions I want to define in the query based on the above results…
Something for example (sorry, I am not trying to write a condition: my question is how to write it),
if column_code1 = RO1 and column_description2 = PDF/ECOPY on status column it should return a value ‘ONLINE’ & on location column it should return ‘WEB’ and on contact column it should write ‘BOB’.
Also,
if column_code1 = RO5 and column_description1 = JOURNAL on status column it should return a value ‘ON PRESS FOR PRINT’ & on location column it should return ‘S.R STREET, LONDON’ and on contact column it should write
‘SMITH’ like below result…so the final output should be the top four columns and the extra three columns…I hope someone can help me into this…thanks a lot…
status location
contact
ONLINE WEB
BOB
ON PRESS FOR PRINT S.R STREET, LONDON SMITHHi artistdigital,
you can use case statment for same in sql server. MSDN link - > http://technet.microsoft.com/en-us/library/ms181765.aspx
Try code like this:
SELECT table2.column_code2,
table2.column_description2,
table2.column_code1,
table1.column_description1,
case when column_code1 = 'RO1' and column_description2 = 'PDF/ECOPY' then 'ONLINE'
when column_code1 = 'RO5' and column_description1 = 'PDF/ECOPY' then 'ON PRESS FOR PRINT'
end as [status],
case when column_code1 = 'RO1' and column_description2 = 'PDF/ECOPY' then 'WEB'
when column_code1 = 'RO5' and column_description1 = 'PDF/ECOPY' then 'S.R STREET, LONDON'
end as [Location],
case when column_code1 = 'RO1' and column_description2 = 'PDF/ECOPY' then 'BOB'
when column_code1 = 'RO5' and column_description1 = 'PDF/ECOPY' then 'SMITH'
end as [contact]
FROM table2
join table1
on table2.column_code1 = table1.column_code1
Regards Harsh -
Need to show the images in calculated column based on the condition in sharepoint 2013.
Hi ,
I'm working in sharepoint 2013, In this i want to show an image in calculated column based on the condition, but image is not showing .
In sharepoint 2010 its working with help of javascript in content editor on the same page. Same thing i tried in SP 2013. but doesn't work.
Could any one please give proper solution for this?
Thanks in advance.
by,
Siva.Hi please provide the JS you have used in the content editor as well as the calculation for the column so we can better understand what's maybe differs?
Blog: chrisstahl.wordpress.com Twitter:
@Cstahl -
Date Difference in SQL Where Condition?
Dear All,
I have a problem while fetching records from two tables LIPS and VAPMA on basis of date difference. My SQL conditions/statements are as follows.
DATA myvar type p.
1. SELECT SUM( lips~lfimg )
FROM lips INNER JOIN vapma ON lipsvgbel = vapmavbeln
AND vapmamatnr = lipsmatnr
INTO myvar
WHERE DATEDIFF(lipserdat , vapmaaudat) = 2.
2. SELECT SUM( lips~lfimg )
FROM lips INNER JOIN vapma ON lipsvgbel = vapmavbeln
AND vapmamatnr = lipsmatnr
INTO mywar
WHERE
lipserdat - vapmaaudat = 2.
Above SQL statements are not working, kindly help me out. Thanking you in advance.
Ahsan MajeedHi
Do like this:
data: begin of itab occurs 0,
vbeln like lips-vbeln,
posnr like lips-posnr,
erdat like sy-datum,
lfimg like lips-lfimg,
audat like sy-datum,
d_diff type i,
end of itab.
data : v_qty like lips-lfimg.
SELECT avbeln aposnr aerdat alfimg b~audat into table itab
FROM lips as a INNER JOIN vapma as b
ON avgbel = bvbeln.
clear v_qty.
sort itab by vbeln posnr.
loop at itab.
itab-d_diff = itab-erdat - itab-audat.
if itab-d_diff = 2.
v_qty = v_qty + itab-lfimg.
endif.
endloop.
Reward if useful
regards
Anji -
Does adding a field to a table affect a data block based on the table?
If I make a change to a table like adding a field does it affect data data blocks based on the table?
The other place I have seen where adding a new column to a table causes problems is when a programmer codes: Select * from table.
If that is coded in a form, the form will need to be recompiled before it will work properly. -
Displaying record based on the condition in Crystal report
Hi All,
I want to display certain records in crystal based on some condition.
For example,
If I am having 5 student records like,
Name Mark1 Mark2 Mark3 Total
aaa 40 50 60 150
abc 30 60 40 130
tcr 25 25 25 75
Now in table i have only 4 fields (STUNAME, MARK1, MARK2, MARK3).
I have to calculate the total at runtime and if total is greater than 150, then actual record should display in report.
For example, I can use formula to calculate total but I can calculate total only after each record prints. But i want to calculate total internally only it should display in report if condition satisfies. I dont want to keep one more field for total in crystal report.
Please help me on this.If the filter is not "pushed" down to the database, then Crystal will pull all of the data into memory and then filter it there. This is not a big deal if you only have a couple of records, but it can significantly slow down a report that is pulling in more than a few records.
An alternative, if your report is just linking tables in the Database Expert, would be to create a SQL Expression that adds the three fields together. Using this in the Select Expert WILL push the condition down to the database.
If you're using a command instead of linking table, they you would add this to the Where clause of the comment. If you're using a stored proc instead of tables or a command, you would want to do this filter in the code for the stored proc.
-Dell
Message was edited by: Dell Stinnett-Christy -
Printing Flag Based on the Condition Request
Hello
I have a requirement where i need to check two conditions on Date and Print the Date in Red and Flag(Symbol) adjacent to the Date, I used Conditional Format and gave my Conditions and then i am ableto print the date in Red , Below is my Conditional Format XML and i am unable to print a symbol adjacent to the Date with the same Condition
Here is my Conditional Format XML
<?if:LE_DT<PRINT_DATE?><?attribute@incontext:color;'red'?><?end if?><?if:ACT_DT='--'?><?attribute@incontext:color;'red'?><?end if?>
i need to print a FLAG symbol also based on this condition
Thanks for your helpSo after the attribute setting you need to put in the flag character. To do this, you will need to put the opening and closing if statements in separate form fields and then put the flag character between them.
<?if:LE_DT<PRINT_DATE?><?attribute@incontext:color;'red'?>FLAG CHAR<?end if?><?if:ACT_DT='--'?><?attribute@incontext:color;'red'?>FLAG CHAR<?end if?>
Bear in mind that the flag character may come from a special font e.g. wingdings. In which case you will need to ensure that font is on the server - check the docs. Or you can conditionally show an embedded image in the same way.
Regards
Tim -
Column data restriction based on join condition
All,
SELECT e.ename,
d.dname,
e.job,
e.comm, e.sal
FROM emp e,
dept d
WHERE e.deptno=d.deptno
AND e.empno =7788
AND e.comm IS NOT NULL;
In this query, if the comm for the empno=7788 is not null, then i am able to retrive the record, If comm is not null, display the entire record along with comm details, if it is null, display the entire record without comm value(may be as null).
If commission is not null, then display the entire record, if it is null, then for e.comm, e.sal I want to display null values.
PS: I am in a situtation like this kind of. Kindly give me some idea.
ThanksThank you Frank and Sorry for not so clear in explanation.
SQL> desc demois_wo_routing
Name Null? Type
ORG_ID NUMBER
ASSIGNED_TO VARCHAR2(10)
COMMENTS VARCHAR2(55)
DUE_DATE DATE
ENTER_DATE NOT NULL DATE -- is the APPROVED_DATE
ENTER_USER VARCHAR2(30) -- is the APPROVER_NAME
PRIORITY NUMBER
START_DATE DATE
STATUS NOT NULL VARCHAR2(10)
WO_NUMBER NOT NULL VARCHAR2(10)
SQL> desc demois_sr_routing
Name Null? Type
ORG_ID NUMBER
ASSIGNED_TO VARCHAR2(10)
COMMENTS VARCHAR2(55)
DUE_DATE DATE
ENTER_DATE NOT NULL DATE
ENTER_USER VARCHAR2(30)
PRIORITY NUMBER
REQ_NUMBER NOT NULL VARCHAR2(10)
START_DATE DATE
STATUS NOT NULL VARCHAR2(10)
SQL> select enter_user,wo_number,enter_Date,status from demois_wo_routing where wo_number='WO000853';
ENTER_USER WO_NUMBER ENTER_DAT STATUS
E60075334 WO000853 14-MAY-13 APPROVED
C10000001 WO000853 09-APR-13 OPEN
C10000001 WO000853 09-APR-13 ASSIGNED
E60075373 WO000853 09-APR-13 PND APPRVL
SQL> select enter_user,req_number,enter_date,status from demois_sr_routing where req_number=(select req_number from demois_req where wo_number='WO000853');
ENTER_USER REQ_NUMBER ENTER_DAT STATUS
E60075373 SR000818 09-APR-13 SCHEDULED
E60075334 SR000818 14-MAY-13 SCHEDULED
C10000001 SR000818 09-APR-13 SCHEDULED
C10000001 SR000818 09-APR-13 SCHEDULED
SQL> SELECT fm.first_name || ' ' || fm.last_name AS approver_name,
2 fpc.communication_value AS approver_cell
3 FROM demo_person fm, demo_person_communication fpc
4 WHERE fm.person_code = 'E60075334' --ENTER_USER from FSR/ FWR table
5 AND fm.person_id = fpc.person_id
6 AND fpc.communication_type = 'Telephone';
APPROVER_NAME
APPROVER_CELL
Nicy Varghese
44952937
SQL> SELECT fm.first_name || ' ' || fm.last_name AS approver_name,
2 fpc.communication_value AS approver_cell
3 FROM demo_person fm, demo_person_communication fpc
4 WHERE fm.person_code =
5 (SELECT enter_user
6 FROM demois_wo_routing
7 WHERE wo_number = 'WO000853' AND status = 'APPROVED')
8 AND fm.person_id = fpc.person_id
9 AND fpc.communication_type = 'Telephone';
APPROVER_NAME
APPROVER_CELL
Nicy Varghese
44952937
ACTUAL QUERY :---- If i run the below query i will definitely get a record of WO_NUMBER along with the other details.
SELECT w.wo_number,
DECODE (NVL (p.print_wo_barcode_flag, 'N'),
'Y', '*' || w.wo_number || '*',
NULL
) barcode_wo_number,
INITCAP (w.maint_type) maint_type, INITCAP (w.wo_status) wo_state,
w.priority, w.modify_date, w.start_date, w.due_date,
INITCAP (w.description) description, w.method, w.crew,
INITCAP (w.craft) craft, w.assigned_to, w.est_hours,
DECODE (w.req_type,
'S', 'Service',
'P', 'PM',
'W', 'Project',
'T', 'Standing WO'
) req_type,
w.req_number, INITCAP (w.requestor) requestor, w.telephone,
w.mail_code, w.department, w.cp_number, w.site, w.building,
NVL (w.phase, 0) phase, w.FLOOR, w.room, w.equipment,
INITCAP (w.close_comments) close_comments, w.alt_requestor,
w.alt_telephone, w.alt_department, w.alt_mail_code, w.schedule_user,
DECODE (w.equipment,
NULL, NULL,
'*' || w.equipment || '*'
) equip_barcode,
INITCAP (e.NAME) employee_name, w.schedule_date, w.pl_number,
INITCAP (q.nomenclature) nomenclature, INITCAP (q.mfr) mfr,
INITCAP (w.nonavailable_time) nonavailable_time, w.enter_user,
a.asset_class_code, INITCAP (a.description) asset_class_description
FROM demois_emp e,
demois_equip q,
demois_req w,
demois_fmm_config p,
demois_asset_class a
WHERE w.wo_number IS NOT NULL
AND NVL (w.asset_type, 'N') = 'N'
AND w.equipment = q.equipment(+)
AND w.assigned_to = e.employee(+)
AND (w.assigned_to = :p_assigned_to OR :p_assigned_to IS NULL)
AND ( (:p_marked_to_print = 'Y' AND w.print_ticket = 'Y')
OR (:p_wo_number IS NOT NULL)
AND (w.site = :p_site OR :p_site IS NULL)
AND (w.crew = :p_crew OR :p_crew IS NULL)
AND (w.craft = :p_craft OR :p_craft IS NULL)
AND (w.maint_type = :p_maint_type OR :p_maint_type IS NULL)
AND (w.req_type LIKE NVL (:p_req_type, '%'))
AND (w.wo_number LIKE NVL (:p_wo_number, '%'))
AND q.asset_class_id = a.asset_class_id(+)
ORDER BY wo_number;
The above is the sample data for my logic. The last one is the original query which am modifying with the tables listed above. The last query will return a record based on WO_NUMBER. Now i have to passing the WO_NUMBER to FWR table checking whether it is in APPROVED status or not. If not need to in FSR table with the associated SR ( req_number) for that WO_NUMBER.
If there is a record in 'APPROVED' state, need to display the approver name from FP and FPC tables by passing value of the ENTER_USER from FSR / FWR. Till now it is fine , if the STATUS is 'APPROVED'.
The problem here is, there may a situation where the WO_NUMBER ( or respective SR number) will not be in 'APPROVED' status in both the tables. In this case also i need to get the record as usual like if i run the last query (ACTUAL QUERY).
There is no direct relation between the FSR and FWR tables here. Only DEMOIS_REQ table has REQ_NUMBER (SR000818) and WO_NUMBER ( WO000853 ).
Again sorry, If i am not clear enough.
Thanks in advance. -
Column value coloring Based on the condition in ssrs 2008
Hi,
I need to change color formating based on below conditions
Red if <=28 days or > 65 days
Green if >28 and <=60 days
Yellow if > 60 days and <=65 days
<=0 No color
I tried with below IIF condition it's not working.
=iif(Fields!HDSI13.Value<=0,
"No color",iif((Fields!HDSI13.Value<=28
or Fields!HDSI13.Value>64),"Red",iif((Fields!HDSI13.Value>29
and Fields!HDSI13.Value<=60),"Green",iif((Fields!HDSI13.Value>60
and Fields!HDSI13.Value<=65),"yellow",Nothing))))
Can any one help me on this.
Thanks,
Manasa.
Thank You, Manasa.Vhi all,
When i wrote like this in table report ...woking fine.
=iif(((Fields!HDSI13.Value<=28
and Fields!HDSI13.Value>0)
or Fields!HDSI13.Value>64),"Red",iif((Fields!HDSI13.Value>=29
and Fields!HDSI13.Value<=60),"Green",iif((Fields!HDSI13.Value>=61
and Fields!HDSI13.Value<=65),"yellow",iif(Fields!HDSI13.Value<=0,"Nocolor",""))))
Thank You, Manasa.V -
Problem in getting the Date object based on the TimeZone
Hi,
I need to create a Date object that holds the time of the specified TimeZone.
I am using TimeZone and Calendar object for that, but when I call the Calendar object's getTime() method, it returns
a Date object that holds the local time.
Can somebody let me know what why?
Here is what I uses in my code.
TimeZone tz = TimeZone.getTimeZone("IST");
Calendar cal = new GregorianCalendar(tz);
System.out.println("Date of "IST" TimeZone = " + cal.getTime());
Instead of cal.getTime, if I do the following I am getting the values correctly.
int month = cal.get(Calendar.MONTH); // 0..11
int day = cal.get(Calendar.DATE); // 0..11
int hour12 = cal.get(Calendar.HOUR); // 0..11
int minutes = cal.get(Calendar.MINUTE); // 0..59
Can somebody let me know why I am not able to assign the Date of the TimeZone specified.
Is there anything wrong with the code?
SebIs there anything wrong with the code?No, only with your understanding of the Date class. From the API:
The class Date represents a specific instant in time, with millisecond precision.
The different time displayed for different TimeZones around the world are just that: a display format for the same instant in time.
To display the "instant in time" in a different TimeZone, use DateFormat. Here's a small sample:TimeZone tz = TimeZone.getTimeZone ("GMT");
Calendar c = Calendar.getInstance (tz);
System.out.println(c.getTime ()); // prints Tue Mar 18 02:56:53 IST 2008
DateFormat dtf = DateFormat.getTimeInstance ();
dtf.setTimeZone (tz);
System.out.println(dtf.format (c.getTime ())); // prints 9:26:53 PMIt's no different from formatting the same number in various ways: 10 decimal == 0xA hexadecimal == 012 octal == 1010 binary. Same value, different representation. Same intant in time, different local time for each zone.
Savvy?
cheers, db -
Altering pages based on the condition
Hi all,
In a smartform there is a requirement like in the main window, if a variable satisfies some condition then it is required to print the table in the next page other wise it need to be displayed in the first page itself.
can any one of you help me regarding this. ie; how to specify it to be printed in first page or secondpage
Thanks in advance,
regards,
tulasi.Hi Deepthi,
A small technically incorrect term was used in the previous post.
That is explicit break-point; actually it is explicit page-break.
What happens "When you create explicit page-break as: Right click on Template-->Create->Flow Logic -->Command" is as soon as the condition is satisfied the next content will be printed on the next page (as specified).
So if your variable satisfies some condition then you can put a explicit page-break to print the table in the next page.
Hope now you got the clarity.
Regards,
Rama chary.P -
Disable a field in a Table layout based on the condition
Hello,
In the seeded page, there is a table layout region with viewobject name as View1. It has 3 fields displayed as Field A, Field B, Field C with multiple rows displayed when the page opens. Fields B and C are MessageTextInputs and Field A is MessageChoice. So in the displayed rows in the table, if the value selected in the Field A is "Bonus" then the fields B and C needs to be disabled so that the user should not be able to enter any information. So if there are 5 rows in that table, only 1 or 2 rows might have the value "Bonus" in the field A and only for those rows, fields B and C needs to be disabled.
I would appreciate if anyone can provide me with a logic. I know how to disable a field based on the value of other field but in this case here, its a table region with multiple rows and only few of them needs to be disabled. I couldn't think of any logic here. Any help is greatly appreciated.
Thank You
KKSimilar problem
Re: How to make Advanced table readonly -
How to calc sum of one column, based on the condition of another column?
I would like to create a formula that adds up the total cost from column F for each specified service in column D. For example, the result for PM (project management) would be $495. Any ideas?
I think you could use this formula, using your cell references:
=SUMIF(D4:D21,"=CM",F4:F21)
Then, change the "=CM' to "=PM", etc. for each service.
Like JaxJason, I can't test this in Numbers right now, but it works in Excel, and the functions are identical.
SUMIF(test-range, "condition", [sum-range]):
* test-range: A reference to the range of cells containing values to test. Must be the same dimensions as sum-range.
* "condition": Any comparison statement that results in a logical TRUE or FALSE value.
* sum-range: Optional; a reference to the range of cells containing the numbers to be added. Must have the same dimensions as test-range. If omitted, test-range is used.
I hope this helps.
- Michael
Message was edited by: Apple fan Michael
Maybe you are looking for
-
Does ThinkVantage System Update 5.06 work on B540 AIO?
Can someone clarify if ThinkVantage System Update 5.06 can be used on the Ideacenter B540 AIO? Says in the ReadMe txt file that it supports Lenovo V/B/K/E Series. Thanks for any help. Solved! Go to Solution.
-
Declare a variable in an Interface
hi all can i declare a variable in a interface , something like public static final String dsn=" // something"; so that i dont have to declare the same thing in all the classes that implement this interface regards
-
BADI/User Exit for validation in WAK1
Hi, I need to put validations in transaction WAK1. for the Site Groups under the site groups TAB. Please suggest if any BADI or User Exit is available to do this. I checked there are BADI's "WAKT_BADI_001" to "WAKT_BADI_008" but they are for SAP Inte
-
How to change the document page size in a PDF?
OK can't figure a way to do this and hoping it's still possible. On mac snow leopard, adobe X pro. Use to be able to resize the pages in a pdf by printing to the pdf distiller. As this is no longer possible how do I accomplish this? I often have docu
-
Download WRT54G v6 CD copy.
Hi ladies and gentlemen I recently found that many people lost their WRT54G v6 CD copy(heard it works with v5 also, not sure.), so I decided to upload my own CD copy for you all in my spare time. It's splited in 3 parts (2 50Mb each, and the last on