I've been struggling with this for a few hours if anyone can help.
=IIF(Parameters!Agent.Value ="Susan Calladine", (Sum(Fields!Susan_Calladine.Value) / Sum(Fields!InvitedToApply.Value),
IIF(Parameters!Agent.Value ="Fazaila Pirbhai", (Sum(Fields!Fazaila_Pirbhai.Value) / Sum(Fields!InvitedToApply.Value),
IIF(Parameters!Agent.Value ="Claire Willis", (Sum(Fields!Claire_Willis.Value) / Sum(Fields!InvitedToApply.Value),0)))
Basically to calculate specific fields based on the value of the parameter being returend
Since the error you're getting no doubt refers to a ')' being expected either add a closing ) to each of your SUM clauses
(Sum(Fields!Susan_Calladine.Value) / Sum(Fields!InvitedToApply.Value))
or get rid of the opening ( in each case
Sum(Fields!Susan_Calladine.Value) / Sum(Fields!InvitedToApply.Value).
Personally I'd go for the second as it will make the expression a little more readable
Related
I am trying to make a formula that changes depending on the cell containing the sex value however I can't seem to correct it. I am new to spreadsheets so I may be missing a big and obvious step.
=IF(C3="Female" (655.1+(9.563C6)+(1.850C7)-(4.676C4)) ELSE IF (C3="Male" (66.5+(13.75C6)+(5.003C7)-(6.75C4))))
So, without an example, this is how I would edit / correct your existing formula:
=IF(C3="Female",(655.1+(9.563 * C6)+(1.850 * C7)-(4.676 * C4)),IF(C3="Male",(66.5+(13.75 * C6)+(5.003 * C7)-(6.75 * C4),"error")))
try:
=IF(C3="Female";
(655.1+(9.563*C6)+(1.850*C7)-(4.676*C4));
(66.5+(13.75*C6)+(5.003*C7)-(6.75*C4))))
i am quite new to arangodb and AQL. What i am trying to do is to find names and surnames with query that have two or more parts that may or may not include spaces (" ") to divide those said parts.
As i went through documents, I figured that those fileds should be indexed as full-text indexes and query would be something like
FOR u IN FULLTEXT(collection, field, "search") RETURN u
Now my question is how to utilize the above query for a Persian/Arabic names such as
سید امیر حسین
Keep in mind that this name comes from an input of a user and it could be in the following formats such as
سید امیر حسین/سید امیرحسین/سیدامیر حسین/سیدامیرحسین
Note the various types of names with/without spaces. I tried the follwoing query F
FOR u IN FULLTEXT(collection, field, "سید,|امیر,|حسین,|سیدامیرحسین") RETURN u
But the problem is this will also result of fetching the name because i reckon the use of OR ( | ) operator.
سید محمد
which is not my intention. So what am i doing wrong or missing here ?
Many thanks in advance and excuse my noobiness
PS : arango 3.8.3
I have a confusing mystery...
Simple DIVIDE formula works correctly. However blank rows are not displayed.
I attempted a different method using IF, and now the blank row is correctly displayed.
However this line is only displayed if I include the IF formula (which gives a zero value I don't want).
Formula 1:
Completion % =
DIVIDE(SUM(Courses[Completed]),SUM(Courses[Attended]),BLANK())
Formula 2:
Completion % with IF =
IF(SUM(Courses[Attended])=0,0,DIVIDE(SUM(Courses[Completed]),SUM(Courses[Attended])))
With only the DIVIDE formula:
Including the IF formula:
It appears that Power BI is capable of showing this row without error, but only if I inlude the additional IF formula. I'm guessing it's because there is now a value (0) to display.
However I want to be able show all courses, including those that have no values, without the inaccurate zero value.
I don't understand why the table doesn't include these lines. Can anyone explain/help?
The point is very simple, by default Power BI shows only elements for which there is at least one non-blank measure.
The DIVIDE operator under-the-hood execute the following:
IF(ISBLANK(B), BLANK(), A / B))
You can change its behaviour by defining the optimal parameter in order to show 0 instead of BLANK:
DIVIDE(A, B, 0) will be translated in the following:
IF(ISBLANK(B), 0, A/B))
Proposed solution
Those mentioned avobe might all be possible solutions to your problem, however, my personal suggestion is to simply enable the option "show item with no data" in your visualization.
While DIVIDE(A, B, 0) will return zero when when B is zero or blank, I think a blank A will still return a blank.
One possibility is to simply append +0 (or prepend 0+) to your measure so that it always returns a numeric value.
DIVIDE ( SUM ( Courses[Completed] ), SUM ( Courses[Attended] ) ) + 0
H= 1..24;
s.t. ElectBattery{h in H}: ES[h]-ES[h-1]-P2S[h]*Efi['ESt']+PGEN['ESt',h]==0;
error: ES[0] out of domain
One way:
Make sure ES[h] is defined over 0..24 (instead of 1..24)
Fix ES[0] to a known value by adding a constraint ES[0]=10 (say).
If you want a steady-state solution, use:
ES[0] = ES[24]
Instead of this, you can also use an if-then-else construct like:
ES[h] - (if h=1 then ES[24] else ES[h-1]) - ..
I can't figure out why this if statement won't work.
I have a DateTime field DATEFROM and a String parameter (it HAS to be String) periodEnd.
I would like to calculate percentages depending if these two dates have 1, 2, 3 or more years difference.
When I use this formula I get either "100%" or "-" and never the other two options. It's like CR calculates the first IF and if it's true then: "100%" but if it's false, it never checks for the rest of the Else Ifs and goes dirreclty to Else
StringVar percentage:="";
If (cDate({?periodEnd})-{TABLE.DATEFROM})<=1 Then
percentage:="100%"
Else If (cDate({?periodEnd})-{TABLE.DATEFROM})<=2 Then
percentage:="66%"
Else If (cDate({?periodEnd})-{TABLE.DATEFROM})<=3 Then
percentage:="33%"
Else
percentage:="-"
Any idea?
a) I assume you already made sure your periodend format matches with what cdate interprets?
If you just subtract them, Crystal by default returns the number of days between.
Two ways you can do year:
datediff("yyyy",cDate({?periodEnd},{TABLE.DATEFROM})
or
year(cDate({?periodEnd})-year({TABLE.DATEFROM})
b) You've also no doubt accounted for when your {TABLE.DATEFROM} is greater than cDate({?periodEnd} and you have a negative result?
Not sure if the following is the behavior you would want, but I'm throwing it in for your information
ABS(datediff("yyyy",cDate({?periodEnd},{TABLE.DATEFROM}))
**make sure you check the help file for the datediff codes ("yyyy" etc) as they are not quite instinctive and can trip you up when you think you're using the obvious one