Function cannot evaluate percentage
Hi All,
Does anyone know how i might be able to get this function to evaluate table cells containing (%) percentage values? It can currently only evaluate cells containing numbers without the (%) sign displayed in the cell.
Any assistance would be much appreciated.
Function Set-CellColor
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true, Position = 0)][string]$Property,
[Parameter(Mandatory = $true, Position = 1)][string]$Color,
[Parameter(Mandatory = $true, ValueFromPipeline = $true)][Object[]]$InputObject,
[Parameter(Mandatory = $true)][string]$Filter
Begin
Write-Verbose "$(Get-Date): Function Set-CellColor begins"
If ($Filter)
If ($Filter.ToUpper().IndexOf($Property.ToUpper()) -ge 0)
$Filter = $Filter.ToUpper().Replace($Property.ToUpper(), "`$Value")
Try
[scriptblock]$Filter = [scriptblock]::Create($Filter)
Catch
Write-Warning "$(Get-Date): ""$Filter"" caused an error, stopping script!"
Write-Warning $Error[0]
Exit
Else
Write-Warning "Could not locate $Property in the Filter, which is required. Filter: $Filter"
Exit
Process
ForEach ($Line in $InputObject)
If ($Line.IndexOf("<tr><th") -ge 0)
Write-Verbose "$(Get-Date): Processing headers..."
$Search = $Line | Select-String -Pattern '<th ?[a-z\-:;"=]*>(.*?)<\/th>' -AllMatches
$Index = 0
ForEach ($Match in $Search.Matches)
If ($Match.Groups[1].Value -eq $Property)
Break
$Index++
If ($Index -eq $Search.Matches.Count)
Write-Warning "$(Get-Date): Unable to locate property: $Property in table header"
Exit
Write-Verbose "$(Get-Date): $Property column found at index: $Index"
If ($Line.IndexOf("<tr><td") -ge 0)
$Search = $Line | Select-String -Pattern '<td ?[a-z\-:;"=]*>(.*?)<\/td>' -AllMatches
$Value = $Search.Matches[$Index].Groups[1].Value -as [double]
If (-not $Value)
$Value = $Search.Matches[$Index].Groups[1].Value
If (Invoke-Command $Filter)
Write-Verbose "$(Get-Date): Criteria met! Changing cell to $Color..."
$Line = $Line.Replace($Search.Matches[$Index].Value, "<td style=""background-color:$Color"">$Value</td>")
Write-Output $Line
End
Write-Verbose "$(Get-Date): Function Set-CellColor completed"
Hi Michael,
If you want to compare the percentage value with percentage range, I can run the script below:
$a=@("%20","%30","%40")
$a|foreach {
if($_ -gt "%20" -and $_ -lt "%40"){
$_
# do stuff like changing the colour to red
If I have any misunderstanding, please let me know.
If you have any feedback on our support, please click here.
Best Regards,
Anna
TechNet Community Support
Similar Messages
-
Front-end functions cannot be executed in the background in SM37
Hi ,
I have developed a BDC program for Tcode HRUSER . The program is working fine in Frontend but when Executed in Background through SM37 gives a error -:
"Front-end functions cannot be executed in the background".
I am not using any function like GUI_DOWNLOAD or anything like that .
Thanks
Nikhil Arya.Hi ,
No , the program is not taking any inputs from the user .
when i am executing the program in background mode it is just showing the messages at the end which i am writing in the program for eg:
"creating a user for employee 2306328".
So , only the list of messages comes at the end .
Thanks
Nikhil Arya. -
Below expression works fine with text box but gives error in dataset expression.
="SET FMTONLY OFF select "+ join(Parameters!Column.Value,",") +" FROM pamcustom.dbo.vw_HFL_HFD_HotfileData INNER JOIN pamcustom.dbo.HFL_HFB_HotFileBatch on BatchID = HFB_intBatchID where BatchID ="+Parameters!BatchId.Value+"
and "+Parameters!cmbTranType.Value+" "+ iif(CountRows("DS_Aml_Mnr_Iss_Desc")=Parameters!Mnr_Iss_Desc.count," "," and aml_mnr_iss_desc in "+"('" & join(Parameters!Mnr_Iss_Desc.Value,"','")
& "')")+iif(CountRows("ds_ReportingCategory")=Parameters!ReportingCategory.count," "," and ReportingCategory in "+"('" & join(Parameters!ReportingCategory.Value,"','") & "')")+iif(CountRows("ds_NAICSubGroup")=Parameters!NAICSubGroup.count,"
"," and naicsubgroup in "+"('" & join(Parameters!NAICSubGroup.Value,"','") & "')")+iif(CountRows("ds_PortTrading")=Parameters!PortTrading.count," "," and porttrading in "+"('"
& join(Parameters!PortTrading.Value,"','") & "')")+iif(CountRows("ds_GL_LE")=Parameters!GL_LE.count," "," and gl_le in "+"('" & join(Parameters!GL_LE.Value,"','") &
"')")+iif(CountRows("ds_coagroup")=Parameters!cmbCoaGrp.count," "," and coagroup in "+"('" & join(Parameters!cmbCoaGrp.Value,"','") & "')")+iif(CountRows("Portfolio")=Parameters!cmbPort.count,"
"," and portfolio in "+"('" & join(Parameters!cmbPort.Value,"','") & "')")+IIf(IsNothing(Parameters!txtSecID.Value)," "," and secid in ('"+Replace(Parameters!txtSecID.Value,",","','")+"')")+iif(IsNothing(Parameters!minPortFilter.Value)
and IsNothing(Parameters!MinPort.Value)," "," and portfolio "+Parameters!minPortFilter.Value+Parameters!MinPort.Value)+iif(IsNothing(Parameters!maxPortFilter.Value) and IsNothing(Parameters!MaxPort.Value)," ","
and portfolio "+Parameters!maxPortFilter.Value+Parameters!MaxPort.Value)+iif(IsNothing(Parameters!minCoaFilter.Value) and IsNothing(Parameters!txtMinCoa.Value)," "," and portfolio "+Parameters!minCoaFilter.Value+Parameters!txtMinCoa.Value)+iif(IsNothing(Parameters!maxCoaFilter.Value)
and IsNothing(Parameters!txtMaxCoa.Value)," "," and portfolio "+Parameters!maxCoaFilter.Value+Parameters!txtMaxCoa.Value)
I guess the error " Aggregate and lookup functions cannot be used in query parameter expressions." is because I am using CountRow to ensure that if all values of multi select all selected i will not use that filter in where clause.
Pls. guide...Hi, Include your parameter total count in the dataset for parameter and instead of using countrows() function use the count from dataset in the expression.
Hope this helps.........
Ione -
Aggregate functions cannot be used in group expressions
Hi have report showing sales by Vendor. I need to list all the vendors with Monthly Total>5000 and combine the rest as "OTHER VENDORS"
Vendor is a Group in my report, so I tried to put an expression as a Group on:
=IIF(Sum(Fields!Mth_1_Sales.Value)>5000,Fields!Vendor_No.Value,"OTHER VENDORS")
I've got an error: "aggregate functions cannot be used in group expressions"
How do I get Vendors with Sales < 5000 into "OTHER VENDORS" ?Hi,
You need to group by Month on group expression,
And you can use the same expression in the report column as
=IIF(Sum(Fields!Mth_1_Sales.Value)>5000,Fields!Vendor_No.Value,"OTHER VENDORS")
Many Thanks
..................................................................................................................................................................Please
mark the post as Please mark the post as answered if this post helps to solve the post. -
Wifi and bluetooth function cannot switch on
My phone cannot switch on the bluetooth and wifi function. Already try restore factory setting. Still cannot on. My phone had drop before this but that time nothing happen just crack behind.. 2 month later just suddenly the bluetooth and wifi function cannot switch on at all.
You should contact your local sony team:
http://www.sonymobile.com/global-en/support/contact-us/
All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien -
I updated to 7.0.1 and my search function cannot find anything now
I updated to 7.0.1 and my search function cannot find anything now
Searching the email. When i type in the keywords, it looks like it's searching, but the results are always the same - nothing found. I've used this function many times daily, I have an enormous amount of emails saved. Thanks...
-
Types of functions cannot used in PL/SQL
I'm trying to find out information on what types of functions cannot be used in PL/SQL. Can someone provide me with some directions and assistance?
Thanks a lot.
Tonyits really depends upon your implementation way..
if u are callinga pl/sql from a trigger, then you can't use any DDL or DML effecting on the same table.
If u are calling a function then it must return only one value, it should not written more than one value. -
Hi,
I have following Query
WITH SET [Union name set test] AS {[Union].[Union Name].&[2],[Union].[Union Name].&[3],
[Union].[Union Name].&[4],[Union].[Union Name].&[5],[Union].[Union Name].&[6]}
SELECT {[Measures].[Emp Count]} ON 0,
{ORDER({[Union].[Union City].[Union City]*[Union name set test]},
[Union name set test].CURRENTMEMBER.MEMBERVALUE, BASC)} ON 1 FROM [Federations];
when i run this query from code as well as SSMS i get following error...
The CURRENT function cannot be invoked in this context because the 'Union name set test' set is not in the scope.
Please help me for this ....Hi Mihirhp,
Base on my research, there are some similar issues and the resault turn out that the Tabular model engine can’t associate .currentmember with a set. The workaround is to use .current in the MDX query. Please try the query below.
WITH SET [Union name set test] AS {[Union].[Union Name].&[2],[Union].[Union Name].&[3],
[Union].[Union Name].&[4],[Union].[Union Name].&[5],[Union].[Union Name].&[6]}
SELECT {[Measures].[Emp Count]} ON 0,
{ORDER({[Union].[Union City].[Union City]*[Union name set test]},
[Union name set test].CURRENT.MEMBERVALUE, BASC)} ON 1 FROM [Federations];
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support -
I need to rename a set of files with a subset of the files' original name. I wrote this script:
dir | rename-item -newname {if ($_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+\s\-\s.+'){$name=$matches[1]; -replace '.+', "$name";}}
This works in that the file and/or directory names are changed, but it also gives me the error:
Rename-Item : Cannot evaluate parameter 'NewName' because its argument input did not produce any output.
At C:\...\FileStrip.ps1:1 char:28
+ dir | rename-item -newname {if ($_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Vivek Shyam:PSObject) [Rename-Item], ParameterBindingException
+ FullyQualifiedErrorId : ScriptBlockArgumentNoOutput,Microsoft.PowerShell.Commands.RenameItemCommand
I'm not sure how to fix this. Any assistance would be appreciated.ok, thanks.
You've avoided the whole 'use the piped data implicitly' thing by the explicit ForEach. I'm ok with that, but I'm still curious how to get the non-ForEach version to not error.
Anyway, what you provided almost worked. I modified to be this:
dir -file |
Where{$_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+\s\-\s.+'} |
ForEach-Object{
$match=$matches[1]
$newname=$_.Name -replace '.+', "$match"
Rename-item $_ $newname
to get it working properly.
But it looks like the simplest form is:
dir -file |
Where{$_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+\s\-\s.+'} |
ForEach-Object{
Rename-item $_ $matches[1] -
FRM-41003: This function cannot be performed here.
FRM-41003: This function cannot be performed here.
Cause: You tried to perform a function that references a table, but current block does not correspond to any table.
Action: No action is necessary. You cannot perform the requested function on this block.
Can some one tell me in which scenarios this error will come?
Cheers
Ram KanalaCheck if the block where you are performing execute/enter query are linked to any table/view of the database.
check the data source property of the block. If it is blank, i.e., if your block is a non-database block, the calls to enter/execute query will return the above said error.
-Hemangi -
Partners in the specified partner function cannot be processed online
Hi all,
After creating a rebate agreement (VBO1) and Processing Customer Hierarchy (VDH1N), as well as setting partner determination (VOPA) for DOCUMENT HEADER as well as DOCUMENT ITEM , the partner function for customer hierarchy is not automatically appearing in sales document header partner tab. And when I am giving it manually in sales doc header, system is giving this error message:
"Partners in the specified partner function cannot be processed online. The program generates them and completes the data automatically".
Regards
AmitHi Amit,
you have to define all exiting partner function assignment to account group (e.g. 1A 1B 1C 1D) please check all partner you have assigned correctly
Regards,
Milind -
CU65 Variant Function cannot be released - check function module interface
Hi ,
Getting this error while Releasing the variant Function in CU66. Function Module trigerred by this function is of the same name as well as correctly acitvated and released , but while releasing the Function I get this error : 'Function cannot be released - check function module interface' . Following are two characeteristics that are maintained in the variant function :
1. Customer_Type
2. Maintenance_Contract
While executing the Function Module alone I get Raise Inernal Exception i.e it is not identifying the argument name 'Maintenance_Contract' in the FM 'CUOV_GET_FUNCTION_ARGUMENT' exception
Below is the code for reference . Pls point out if any mistakes :
""Local Interface:
*" IMPORTING
*" REFERENCE(GLOBALS) TYPE CUOV_00
*" CHANGING
*" REFERENCE(ZQUERY) TYPE ZQUERY
*" REFERENCE(ZMATCH) TYPE ZMATCH
*" EXCEPTIONS
*" FAIL
*" INTERNAL_ERROR
" Data Declaration
DATA : l_main LIKE CUOV_01-atwrt,
l_cust LIKE CUOV_01-atwrt.
" Get value of Input Characteristic Maintenance Contract
call function 'CUOV_GET_FUNCTION_ARGUMENT'
exporting
argument = 'MAINTENANCE_CONTRACT'
IMPORTING
SYM_VAL = l_main
tables
query = ZQUERY
EXCEPTIONS
ARG_NOT_FOUND = 1
if sy-subrc <> 0.
RAISE INTERNAL_ERROR.
endif.
" Get value of Input Characteristic Customer Type
call function 'CUOV_GET_FUNCTION_ARGUMENT'
exporting
argument = 'CUSTOMER_TYPE'
IMPORTING
SYM_VAL = l_cust
tables
query = ZQUERY
EXCEPTIONS
ARG_NOT_FOUND = 1
if sy-subrc <> 0.
RAISE INTERNAL_ERROR.
endif.
IF l_main EQ 'NO'.
IF l_cust EQ 'CURRENT'.
l_cust = 'NEW'.
ELSEIF l_cust EQ 'VAR CURRENT'.
l_cust = 'VAR NEW'.
ENDIF.
ENDIF.
" Set value for the output characteristic
call function 'CUOV_SET_FUNCTION_ARGUMENT'
exporting
argument = 'CUSTOMER_TYPE'
vtype = 'CHAR'
SYM_VAL = l_cust
NUM_VAL =
tables
match = ZMATCH
EXCEPTIONS
EXISTING_VALUE_REPLACED = 1ZMATCH and ZQUERY are two table types created in SE11 , both of type CUOV_01.
-
Added Jcombobox into awt.frame causing handling event function cannot receive event
Dear Sir,
I want to ask how an awt.Choice can set the number of rows that it can display, like the method setMaximumRowCount in JCombobox. Since I want to set more row can be displayed, but choice no any method can set. And I have tried to add Jcombobox into awt.frame, then, the handling event function cannot receive event for the right-top cornet button(minimize, maximum, close).
Best Regards,please post a Short, Self Contained, Correct Example showing your problem.
bye
TPD -
Using the Genesis Framework on my WordPress site. I can use Safari and IE. However, when I try to use Fire Fox, it will not appear. I deleted all of my Custom CSS and Functions. Still, nothing is working. Contacted bluehost, the representative there was not able to help me out and also emailed CD Baby to see what might work. I am not sure if it is something with my site using HTTPS instead of HTTP of why this is not working? I am told the plugin works on Fire Fox but I cannot for the life of me figure out what's going on. Also changed themes and used Twenty Thirteen among others. Still the same thing. Fire Fox will not work. Tried in Text widget, and pasting on a page, and still not working. IE and Safari it is fine. Do I need to add something else within my site? Thanks ahead of time for any way to solve this situation.
There is mixed active content loaded in an iframe that Firefox is blocking as you can see by the shield icon at the left end of the location/address bar.
*https://developer.mozilla.org/Security/MixedContent
*https://developer.mozilla.org/Tools/Web_Console -
@Rank function using EVALUATE
Hi short question,
I'm trying to get the @rank function to work in combination with OBIEE 10.1.3.4 (using EVALUATE). Anyone here already tried using this with Essbase version 9.2? In some of the documentation it states this can not be done using anything below Essbase 9.3 but the @Rank function is available within v9.2 Is there any limit on using this from the OBIEE side?
I used this reference:
(how to:) http://oraclebizint.wordpress.com/2008/04/28/oracle-bi-ee-101332-handling-sort-order-in-hyperion-essbase-931-evaluate-and-mdx/
(Essbase 9.2 doc --> @Rank available) http://download.oracle.com/docs/cd/E12032_01/doc/epm.921/html_techref/techref.htm
Evaluate function I'm trying to launch is:
EVALUATE(’RANK(%1.dimension.currentmember,%2.members)’ AS INTEGER,Period."PeriodGen4",Period."PeriodGen4")
Am I doing something wrong here, or am I trying to do things which can't be done?
Thanks in advance,
MathijsI tried the syntax
EVALUATE ('RANK(%1,%2)' as integer,"Account"."Gen4,Account Default","Account"."Gen4,Account Default")
but still i am getting the error as:-
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 96002] Essbase Error: Syntax error in input MDX query on line 6 at token 'RANK' (HY000)
SQL Issued: SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7 FROM ( SELECT 0 s_0, "FINRPTC#1"."Account"."Gen3,Account Default" s_1, "FINRPTC#1"."Account"."Gen4,Account Default" s_2, "FINRPTC#1"."FinancialYear"."Gen2,FinancialYear" s_3, "FINRPTC#1"."Period"."Gen3,Period" s_4, EVALUATE ('RANK(%1,%2)' as integer,"FINRPTC#1"."Account"."Gen4,Account Default","Account"."Gen4,Account Default") s_5, "FINRPTC#1"."FINRPTC"."Actual" s_6, REPORT_AGGREGATE("FINRPTC#1"."FINRPTC"."Actual" BY "FINRPTC#1"."Account"."Gen3,Account Default","FINRPTC#1"."Account"."Gen4,Account Default","FINRPTC#1"."FinancialYear"."Gen2,FinancialYear","FINRPTC#1"."Period"."Gen3,Period") s_7 FROM "FINRPTC#1" WHERE (("FinancialYear"."Gen2,FinancialYear" = 'FY12') AND ("Period"."Gen3,Period" = 'Nov') AND ("Account"."Gen3,Account Default" = 'Net Cost of Services')) ) djm
Maybe you are looking for
-
Mouse clicks not detected on JTabbedPane
Hi all, I have a JPanel placed inside a JTabbedPane. I want to double-click on the JPanel and bring up a JDialog. This works fine if the JPanel is not in a JTabbedPane, but if it is on a JTabbedPane, then the mouse clicks are not detected. I'd greatl
-
My company a large multinational with more than 10000 employees worldwide, is currently looking for an "entry level" LabVIEW developer in the North East of England, although all levels of experience could be considered. If anyone is interested, pleas
-
Is there a trick to publishing 2 versions of the iPad app?
I have published two folios for ipad, v25 and v29. Do I need to publish the v25 version first or is there a trick to this? Here is a response from one of our subscribers. Why is this happening to her? "I love the tablet addition as I live overseas a
-
My Macbook pro came with snow leopard. I decided to upgrade to lion so I could use cloud. Now I can't open any word doc. that I receive in emails. Is there any way to remedy this?
-
How do I install Tekton MM in CS5 running on Windows 7 (32-bit)?
I called up a file done in an earlier version of InDesign (probably CS4) on my previous computer running Windows XP, and on the new computer it indicated that Tekton MM regular was missing. I had the Tekton MM files on my old computer in a PSFonts fo