Question on MDX Dimension Formula.
Dear Experts,
Can any body explain me wht is MDX & importance in BPC.
And how can i execute this below code.
IIF(Account.H1.CurrentMember is Account.H1.[All Account.H1] And
Account.H3.CurrentMember is Account.H3.[All Account.H3],
(Account.H2.IFRSTRATE/Account.H2.WKSYR)*Account.H2.WKSCURMTH, NULL)
And Where i can see output.
I saw in a Function "AvgBal(FSA200)" in Formula Column of Account Dimension in a Sample Application. From where i can call this function & see out put.
Please explain.
Cheers,
Hi Vadim,
okay, let me explain the full Excel sheet in detail. It contains several reports all based on the same rows (accounts) and with the same dimensions in columns (datasource and entity). The difference is the members selected for datasource and entity. The whole report on one screenshot doesn't work, so here is the top left part:
The yellow columns are the first report, the grey column to the right is my local member. Then follows the next report with a few columns, then another and so on.
If we look at the local member in detail:
you can see the formula is a sum listing individual members. In my options, the local member recognition is on and the option to use the position in axis is off.
This is the definition of the local member
My first attempt was to replace the formula with the one given above.
the result is
the sum now has only one element.
I then tried to change the local member to this.
which made the column disappear completely.
Thanks,
Arnold
Similar Messages
-
Problem Iif formula. MDX dimension formula
Hi experts,
I have a quite problem with tolerance in validation rules. When user tries to change Workstatus, system don't let it, because it detect that validation account is not equal to zero, however value of this account seems to be zero.
I know tolerance doesn't works fine on 7.0 MS version. Because of this we are trying to create an MDX formula on dimension account, but system give us this error.
- [CUENTA].[H2].[#X000] Parser: The end of the input was reached.
Our Dimension AccountL (Cuenta) has 3 hierachies. BLOQ_FASEC member is a parent member which sum all validation account.
We are trying to introduce a formula in other account member, giving to this one a tolerance.
Formula introduced is this one:
Iif(Cuenta.H2.BLOQ_FASEC < 0.5 and Cuenta.H2.BLOQ_FASEC > -0.5,0,Cuenta.H2.BLOQ_FASEC)
Could you help us?Hi again,
Just to be on the same page...
- You have 3 hierachies in your Excel dimension file (PARENTH1, PARENTH2, PARENTH3)
- You have 3 Formulas columns in your Excel dimension (FORMULAH1, FORMULAH2, FORMULAH3)
- What I would like to know is, what are the dimension properties assigned to your dimension (Admin console --> Maintain dimension properties...). Here, you should ONLYhave one FORMULA dimension property assigned, even using multiple formula columns in you Excel file.
Then, if you setup that in that way, this is correct... But you should write your dimension formula only in FORMULAH2 column.
In fact, you cannot mix members from hierarchy 1 to calculate a member for hierarchy 2 for example. So, in one hierarchy you can just use members from that hierachy. Can you confirm that?
Then, could you also confirm that all your dimension formulas are using the correct syntax (WITH BRACKETS)..
Example: "[Cuenta].[H2].[BLOQ_FASEC]"...
Best Regards,
Patrick -
MDX Dimension formula - sum using property
Hi All,
I am trying to add a dimension formula on the account dimension sheet and the goal is to add all the accounts that have a property TEST='Y' into a new account TESTACCOUNT
Here is the formula that I am using but it errors out while processing.
ID----
FORMULA
TESTACCOUNT----
SUM([ACCOUNT].[H1].properties("TEST")="Y"),solve_order=10
Can you please tell me where I am going wrong.
Thanks in advance for your help.
Swaroop
Edited by: SwaroopLalam on Aug 13, 2009 4:18 PM
Edited by: SwaroopLalam on Aug 13, 2009 4:19 PMHi Petar,
Thanks for your prompt reply. I tried the following and even that did not work. Am I doing something wrong here? Please see the error I received while processing the dimension;
'sum(FILTER(descendants(ACCOUNT.[TESTACCOUNT],99,leaves),account.properties("TEST")="Y"),measures.periodic),solve_order=15
ERROR:
- [ACCOUNT].[H1].[#TESTACCOUNT] CustomRollupFormula([Account].[Account_H1_ID6].[TESTACCOUNT]) (1, 61) The 'Account' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.
after that I gave the Heirarchy [H1], below;
'sum(FILTER(descendants([ACCOUNT].[H1].[TESTACCOUNT],99,leaves),account.properties("TEST")="Y"),measures.periodic),solve_order=15
ERROR:
- [ACCOUNT].[H1].[#TESTACCOUNT] CustomRollupFormula([Account].[Account_H1_ID6].[TESTACCOUNT]) (1, 65) The 'Account' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.
Thanks,
Swaroop
Edited by: SwaroopLalam on Aug 17, 2009 5:14 PM -
MDX dimension formula in BPC to get the previous month failed with parents
Hi,
I'm working on a proof of concept and I need to create a formula with the following requirement:
Requirement
Account2 = Account2 (Previous Month) + Account 1
Accounts -Jan-Feb-Mar-Q1
Account1_____15___25___45____85
Account2_____15___40___85___140 <== OK
Now, I was thinking of applying this formula within Dimension, using MDX. Then I tried with these two examples, but they didn't work when rolling up to parents. I mean, the calculation for every month works fine, but, the Total Quarter or the Total Year are wrong:
Attempt 1:
Account2.Formula = (ParallelPeriod([Time].[Month], 1, [Time].CurrentMember), Account2) + Account1
Accounts -Jan-Feb-Mar-Q1
Account1_____15___25___45____85
Account2_____15___40___85____85 <== WRONG
Attempt 2:
Account2.Formula = (Account2,[Time].PrevMember) + Account1
Accounts -Jan-Feb-Mar-Q1
Account1_____15___25___45____85
Account2_____15___40___85____85 <== WRONG
How can I solve this ? Should I use Script logic instead of MDX to perform this calculation ?
Thanks!
Diego.DON'T use MDX script logic. It does not perform well under high data volumes or concurrency.
You're calculation can be done easy enough in SQL logic provided you scope the code correctly. Based on what you have given as requirements, the basic code would be something like:
*XDIM_ADDMEMBERSET TIME = PRIOR
*XDIM_ADDMEMBERSET ACCOUNT=A2
*WHEN ACCOUNT
*IS "A1"
*REC(EXPRESSION=%VALUE%+GET(ACCOUNT="A2",TIME=PRIOR),ACCOUNT=A2)
*ENDWHEN
*COMMIT
The first two lines make sure you have the prior period values for A2 in the scope of exection. Then when a record for A1 comes through, it would take that value and add it to A2's prior value for the exact same intersection of all other dimensions. You would separately have to deal with moving forward values of A2 if there were cases where you could have a value for A2 in a prior period but not have a value in A1 for the current period.
Edited by: James Sharrett on Apr 14, 2008 9:51 AM -
BPC 7.5NW SP08: "unknown MDX error" message for simple dimension formula
Hi everyone!!
We are facing many different issues concerning dimension formulas and
script logic. Maybe it's something related to SP08. For instance,
consider the following:
- there is a dimension named P_Account, with members Price, SalesCost,
and others
- there is a dimension named P_Product, which consists of a hierarchy,
for instance: Prod1 with two children, Prod1A and Prod1B
We want to set the following dimension formula in P_Product for Prod1 member:
IIF([P_Account].CURRENTMEMBER.PROPERTIES("ID") = "Price", Null, 1)
that is, we wanted to try to be able to avoid summing Price, returning
Null for (Price, Prod1). Later we would try to replace "1" with the
appropriate formula to sum children of Prod1 for all other members of
P_Account. The result is an odd error: "MDX statement error: unknown MDX
error" (or something similar, since I get the error message in portuguese).
We have spent almost two days studying alternatives in SDN Forum, blogs,
google, etc, trying to find a reason for the error but couldn't find it.
Could anyone help on this one?
Thanks!
LuigiHi everyone!
After contacting SAP, we were asked to try to reproduce the error in APSHELL. I did the following:
1) created another application set, copying APSHELL, named it TESTAPPSET;
2) added two members to dimension P_ACCT (ID, ACCTYPE, SCALING, RATETYPE):
(PRICE, INC, Y, END)
(SALESCOST, INC, Y, END)
3) saved to server and processed P_ACCT dimension successfuly
4) added a UD dimension copied from P_Activity, named P_Product
5) deleted all members of P_Product, processed the dimension sucessfuly
6) added FORMULA property to P_Product, with size 200
7) added three members to P_Product (ID, PARENTH1)
(Prod1, "")
(Prod1A, Prod1)
(Prod1B, Prod1)
8) saved to server and processed the dimension successfuly
9) edited P_Product members and added the following as FORMULA for Prod1:
IIF([P_ACCT].CURRENTMEMBER.PROPERTIES("ID") = "PRICE", Null, 1)
Result was sucess!!
10) edit P_Product again and removed the formula, saved to server and processed dimension successfuly;
11) created an Application named SALES, type Financial Report, copied from PLANNING with dimensions
12) edit dimensions, removed P_Activity and added P_Product to the list
13) went back to step (9) and tried to add the formula again, saved to server and processed P_Product dimension. Result was success again!!
So I imagined the issue might be caused by the user I was log in with. I went back to our application set, logged in as BPC_SYSADMIN and tried to set the formula again and it didn't work. User was not the problem.
Since I had tried all the above creating everything with all UPPERCASE, I decided to try the following Formula
IIF([P_ACCOUNT].CURRENTMEMBER.PROPERTIES("ID") = "Price", Null, 1)
that is, P_ACCOUNT instead of P_Account. Result: success in processing dimension!!! And the formula worked as expected when I opened an Input Schedule to test it.
When I check my dimension list in BPC Admin it says P_Account (mixed case), instead of P_ACCOUNT (all uppercase) since it was the way we created it.
So, I spent 1hour to do the whole test, but it worked. I sent two questions/requests for correction or improvement to SAP:
I) which case should be used in formulas? given I see P_Account in Dimension list, how should I know that I should write formulas with P_ACCOUNT, all uppercase?
II) could BPC provide more descriptive error messages when processing dimensions and validating script logic? a simple error message such as "unidentified command or reference at P_Account" or anything similar would have saved us 4,5 days of work! it's a lot!
Thank you guys for your support!! -
I have dimension members values with formula. Though values are generated at member level,at the parent hierarchy level the values are not getting rolled up.
I am in BPC7NW...any suggestion , inputs welcome...D,
I think there is some miss communication between your question and my answer..either i'm not able to understand it correctly
pls answer these questions.
1)your formulas are getting calculated and right amnts are posted to the base level?
2)how are you checking it.?
3)refresh your client DIM files under options in your EVDRE and check them again..
again...if the correct values are posted to your base members...the mdx formulas job is done...
for rolling it up to the parents is your BPC job (cube, hierarchy,report)
why dont you try writing the same formula on the APPSHELL Copy and check the results...
hope this helps D....
I cant think of anything else... -
Dimension formulas & SQL AS 2005
I'm in the planning process right now for the upgrade from 4.2 to 5.1. We have already had a technical with SAP and recently one with the consultants that will be assisting us with the upgrade. One of the main concerns that our consultants had was the amount of dimension formulas that we have within our application. They spoke about an issue with MS AS 2005 and the performance hit associated with dimension formulas. They also said that Microsoft would not be addressing this within SQL 2005, but that there would be a fix in 2008. That being said, I have 2 questions.
1) Does anyone know if there is a MS Knowledge base article that I can reference?
2) Does anyone have any advice for where to begin addressing the dimension formulas and moving them into business rules and/or sql?It has always been the case that you should avoid using MDX for formulas that cannot be calculated at all levels with the same rules. Though Ive seen lots of cases where people write a lot of MDX that should never have been written and could be done better in either scripting logic or spreadsheet logic. Lots of nested IIF statements or other complex expressions will generally perform poorly. If AS cannot use aggregations or the formulas are sufficiently complex that AS cannot determine for sure if it can use the aggregations then it will perform the necessary aggregations at query time to derive the values. This ABSOLUTLY kills AS performance. The major performance factor in AS is the pre-aggregations as far as query time goes.
For example you can do a Units x Price calculation in MDX and write the formula so that it will be correct at the base members and all rollups. However, if you pick a top level member the query will run forever because AS will calculate every leaf level UxP calculation below the level you are at across the hierarchies and then aggregate all the values to derive the correct value. Ive seen calculations like this run for hours. This is the entire reason that scripting logic was created to allow these types of calculations to be executed in the relational store and the results aggregated along with the other data in AS.
MDX should only be used for things such as basic reporting ratios such as Gross Margin Pct which is simply [Gross Margin]/[Sales] regardless of the level you are at in the hierarchies and will easily use any aggregations that are available at the intersection that the query is requested for. This is true for AS 2000, 2005 and Im sure it will be in 2008. This has nothing to do with BPC, its simply the strengths and weaknesses of AS.
What we have seen is that in AS 2005 it is more prone to performance issues so greater care in how a formula is written is needed. Also, with BPC 5.x the way multiple hierarchies was changed as discussed earlier so even Gross Margin Pct become a more complicated formula in the presence of multiple hierarchies (in the dimension that the formula is written in) just from the syntax required to qualify out the various hierarchy cases. -
Using Dimension Formulas to sum data based on different criteria
Hi all,
I am trying to use a u201CDimension Formulau201D to perform the following calculation:
We have an account dimension which has 2 important properties:
1. CRITERIUMTYPE: This property can have 3 different values: u201CWERKu201D, u201CINVu201D OR u201CLIQu201D
2. ACCTYPE: This property can have 2 different values: u201CEXPu201D or u201CINCu201D
The client wants to have a report that sums data based on these 2 properties. An example will help to clarify this:
ACCOUNTS CRITERIUMTYPE ACCTYPE VALUE
ACCOUNT A WERK EXP 100 u20AC
ACCOUNT B WERK INC 150 u20AC
ACCOUNT C WERK EXP 200 u20AC
ACCOUNT D WERK INC 300 u20AC
ACCOUNT E INV EXP 50 u20AC
ACCOUNT F INV INC 100 u20AC
ACCOUNT G INV EXP 200 u20AC
ACCOUNT H INV INC 500 u20AC
The clients wishes to see this data in the following way:
CRITERIUMTYPE ACCTYPE VALUE
WERK EXP 300 u20AC
INC 450 u20AC
INV EXP 250 u20AC
INC 600 u20AC
In order to achieve this I have created several new accounts, one for each combination e.g.: Account WERKEXP is used to sum the data on the combination CRITERIUMTYPE=WERK and ACCTYPE=EXP. I have created a dimension formula in my account dimension but this is where I am stuck. I have created the following formula to calculate the account WERKEXP:
IIF([BUDGETPOSITIE].CURRENTMEMBER.PROPERTIES("ACCTYPE")="EXP",IIF([BUDGETPOSITIE].CURRENTMEMBER.PROPERTIES("CRITERIUMTYPE")="WERK",[BUDGETPOSITIE].CURRENTMEMBER,0),0)
The problem with this formula is the following:
The formula will add all amounts that meet the 2 criteria mentioned in the formula, EXP and WERK, but as soon as it finds an accounts that does not match the 2 criteria it will set the account WERKEXP back to 0. I need to know if there is a way, using dimension formulas, of adding these values together without the new account being set to 0 as soon as one of the accounts it needs to check does not meet 1 of the 2 criteria.
We are working on SAP BPC 7.5 for NW with SP04
All help is very much appreciated!
Kind regards,
StefanoHi,
You can also use ParentHn property to have different grouping of accounts within the dimension.
So in your case rather using the member formula you can have four accounts and add them in the Parenthn property for grouping it.
1. The Solution proposed by Nilanjan is specific for a Report/IS and Performance will be good
2. My solution will be global something similar to MDX formula, but performance may be slightly lesser than using excel function.
Hope this helps,
Regards,
G.Vijaya Kumar -
Error in Dimension formula to find the average price
Hi all,
I have tried a dimension formula to find the average price of Product.
if the product is a parent level member then average price should be the average of the list price,other wise it should be the list price itself.
IIF([PRODUCT].CURRENTMEMBER.PROPERTIES("CALC")="N",[KEYFIGURES].[LISTPRICE],AVG(DESCENDANTS([PRODUCT].CURRENTMEMBER,[KEYFIGURES].[LISTPRICE],LEAVES)))
While i tried the same i received some strange error , i don know whether its having some dependency on the Customer dimension. since K0030101 is a memebr belonging to CUSTOMER dimension.
MDX statement error:"Value K0030101 for characteristic /CPMB/U6D7SXT un"
I'm not sure whether its an error with the formula i created or any dependancy issue or whether this scenario is possible using dimension formulas or not.
Thanks in advance .
Anila MohanHi everyone!
We are using BPC 7.5 NW SP08 and we've had the same error message while adding a formula to the Account dimension:
'MDX statement error: "Value 1 for characteristic /CPMB/S9D7Q23 un".
We then checked in BW for /CPMB/S9D7Q23 and found out that it was the Product dimension.
The solution for the issue was quite interesting. I had seen in another post that sometimes CALC property was not correctly determined for SP08. The solution proposed was to edit dimension members, clear ParentH1 column, process dimension, re-edit, paste back ParentH1 values and process dimension again. This corrected CALC property problem.
It also worked for my case. After doing it to Product dimension I tried again to set the formula in Account dimension and it worked!!
Hope this helps.
Regards,
Luigi Laporte -
I am copying the dimension formula from BPC5.1 to 7.0.
However following dimension forumula does not work in BPC7 when copied as it is.
ACCOUNT3 = -PrevBalance(ACCOUNT4)
ACCOUNT3 is the dimension member "which stores the previous month balance of Account 4.
I am surpraised why the formula which used to work in 5.1 does not work in 7
Can someone tell me what is wrong or give me link to know the MDX formula changes from 5.1 to 7
Any document link or reference that I can refer to..Hi,
As Carlos specified, you can check the below lines in the OPTIONS tab of your dimension sheet.
*SYSLIB MDXLIB.LGL
*INCLUDE CONSTANTS.LGL
In addition to the above, I would request you to check few more things.
1. How many hierarchies do you have? If more than 1 hierarchy, then, are ACCOUNT3 and ACCOUNT4 are in the same hierarchy? If not, then the formula wont work. If yes, you will have to specify it as ACCOUNT.H1.ACCOUNT4.
2. Try the formula (PrevBalance(ACCOUNT4)*(-1))
Hope it helps. -
Hello All,
I am trying to implement account dimension formulas for the calculation of ratios, but while it is processing successfully, I am not seeing any results.
A couple of questions:
1. Do dimension hierarchies have to be qualified in NW as it does is MS?
2. Does the function Val not work in NW? I am trying to use the value in the weeksinperiod property of the time dimension in the formula. In the MS version, I used to have to convert the property value to a numeric value in the formula. When I use it in NW, I am getting as error for the function, Val.
Below is my formula. If anyone could offer some guidance, I would really appreciate it.
IIF([AccountCC].[EARNED_HOURS_2]=0,NULL,[AccountCC].[EARNED_HOURS_2]/[TIME].CURRENTMEMBER.PROPERTIES("WEEKSINPERIOD"));SOLVE_ORDER=4
Regard,
karenI just noticed the message removed the brackets around my dimension names. I forgot to set the formula as code. Here it is again.
'IIF([AccountCC].[EARNED_HOURS_2]=0,Null,[AccountCC].[EARNED_HOURS_2]/[TIME].CURRENTMEMBER.PROPERTIES("WEEKSINPERIOD"));SOLVE_ORDER=4
Regards,
karen -
Dimension Formula versus Script Logic that runs on default
Hi Experts,
Which is better to use dimension formula or script logic that runs on default? We have a lot of dimension formulas and when noticed that it has a huge impact in the performance of our AppSet. When we try to remove them, the performance seems better. We we're thinking of transforming these dimension formulas into script logic which will run by default instead. Right now I'm hesitant with two things, 1.) Will there be improvement in performance if I all these formulas are run at default via script logic? 2.) The maintenance seems to be much more complex for the user if we use script logic.
Thanks,
MarvinHi Marvin,
Actually you pointed very well the advantage and disantavage regarding dimension formula.
Dimension formula are executed into run time which means that value are not calculated. Of course this will have an impact regarding performances.
Usually our recommendation is to use dimension formula just when yoiu have KPI's to calculate which will be very difficult to be implemented into SQL scrip logic or when you have very simple calculation like Account A = Account B+ Account C.
For other calculation we advice our customer to use script logic.
But attention:
Default formula should not become very heavy because you will arrive into other issue with performances.
When you will send data if default formula script will be heavy you will arrive into situation to wait may be minutes just to send one figure and of course this will be not acceptable for users.
So you have to use script logic but you have to run into batch mode (schedule package) that script logic.
Into default formula you have to keep just minimum (you have to calculate just figures which have importance for user imediat, real time).
Also you have to be aware that moving dimension formula into scrip logic actually your fact table will grow a lot because the number of records generated will be probably 3-4 times bigger than number of records from fact table with dimension formula.
Maintenance of script logic is more complex than dimension formula and you pointed very well this.
So it is a balance and I tried o provide you suggestions or best practice when you have to use dimesnion formula and you have to avoid dimension formula.
I hope this will help you to arrive to best combination for your application.
Kind Regards
Sorin Radulescu -
Hi,
There are dimension formulas maintained in my Account dimension. When I am processign the dimension, the processing is failing telling that for few of the members, the formula is getting in to an infinite recursion. I have checked the code a lot of times. However, unable to understand why this error is coming.
The formula for one of the dimension members looks like this
((Account.H2.PL332000+Account.H2.PL331000)/(val([Time].properties("Monthnum"))/12))/
([Account.H1].[FTE_R_D],[ACCDETAIL].[FTE_TOT]),SOLVE_ORDER=50
Kindly help me.Thanks Sorin for the response.
In that case, what can be the solution?
I have seen examples in which members from different tables, like accdetail, are used in the formulas. They are working absolutely fine.
My understanding says that the different hierarchies are stored in different tables. So, hierarchy 1 will be stored in the table Account.H1 and hierarchy 2 will be stored in Account.H2.
If, we are able to use members which is present in accdetail table, ideally we should be able to use the members which are present in Account.H2 as well. Its just the table from where we are fetching the members.
Kindly help me if I am wrong in my concept -
Hello all,
I have created the following dimension formula in dimension Groups(Currency):
'IIF([DataSrcDim].H1.CurrentMember is [DataSrcDim].H1.[20_ELIM], [GROUPS].MemberX-[GROUPS].MemberY-[GROUPS].MemberZ-[GROUPS].MemberW,NULL),SOLVE_ORDER=50
In short the objective of this formula is to perform a calculation (X-Y-Z-W) on GROUPS dimension members if the DATASRC dimension member is 20_ELIM.
However, I get the following error when I process the GROUPS dimension:
-"[GROUPS].[#ABCD] The dimension '[DATASRCDIM]' was not found in the cube when the string, [DATASRCDIM].[H1], was parsed"
I get this error even though the DATASRC dimension exists in th cube/application.
Would any of you have an idea why this error occurs and if so how can I correct it?
Thank you & regards
RajaHi,
Please try the formula as:
IIF([DATASRC].CurrentMember = "20_ELIM", [GROUPS].[MemberX]-[GROUPS].[MemberY]-[GROUPS].[MemberZ]-[GROUPS].[MemberW],NULL);SOLVE_ORDER=50
Hope this helps. -
BPC Netweaver dimension formula SUM and AGGREGATE
Hello
Does anybody knows the arguments we can use with SUM and AGGREGATE in a dimension formula in BPC NW.
I would like to aggregate data on a hirarchy but not from leaf level only the child at a specific level (do an average at a certain level and then do an aggragate of the children at upper level).
Any idea how to use CHILDREN with SUM or AGGREGATE ?
Thanks
RegardsHi Anne,
Note [1550366|https://service.sap.com/sap/support/notes/1550366] solves part of your problem (in SP06), but these formula results will not roll up the hierarchy and you still cannot reference formula members within formulas, so you will not easily be able to aggregate the averages that you calculate.
It would probably be better to calculate your averages in script logic and assign them to normal base members.
Ethan
Maybe you are looking for
-
I have changed my Apple ID...now how do I change the default apple ID on my Ipad....the apple ID is greyed out so cant change it...
-
Exporting data from a html format into database
Hello: Maybe someone can help me. I wrote a Test Stand program and save the test results in the html format everyone liked be able to access the data thru a web page but now we want to save the data to a database witch I was able to do. I need import
-
How do i add an external hard drive to my network
how do i add an external hard drive to my network
-
Recently, my Audigy 2 started locking up and sqealing like a pig, so I thought I'd try to get new drivers from Creative's webpage. I am kind of confused when looking at the "drivers" available to me (Audigy 2, Windows XP). I have these choices.... .
-
I updated iphone 3G to latest software and since then it doesnt recognise sim card and wont restore, any thoughts yall? iPhone 3G, iOS 5.1