rdlc (piechart) customized colors for different segments - rdlc

I have written a code like below, my problem was sometimes I am getting same color for different segments in the piechart if the value came from the same range.
ref:
rdlc expression iif use?
my code sample
=SWITCH(Fields!ID__Share_of_Costs.Value <= 0.99, "Yellow",
Fields!ID__Share_of_Costs.Value <= 30, "Teal",
Fields!ID__Share_of_Costs.Value <= 60, "SteelBlue",
Fields!ID__Share_of_Costs.Value <= 100, "Crimson",
)
for eg: suppose my chart value is dynamic and it will come like 22 and 29, in this case the segment will show the same color (<= 30, "Teal",) as it is difficult to differntiate. Is there is any way to give different colors for each segment like no repeated color ?
Thanks in advance...cheers

It depends what do you mean by segment (range of values or particular value) or in other words is number of your segments limited?
If yes, then you could set up as much segments as you want with particular color.
If no, then write a custom function which will return hex value as your color.

Related

Decimal Round figure Condition

enter image description hereI want to round the figure of "Rate" if the decimal value becomes .5 or higher (For Example if 17.57 I want it as 18, if 20.98 I want it as 21)
On the other hand, if the decimal value becomes lower than .5 (For Example if 17.23 I want it as 17, if 20.49 I want it as 20)
I am attaching an image. Please let me know the condition.Thank you.
You just need use Round() function as below:
select round(86.54,0) //zero will fix in your case
Use round function
select round('19.6',0)
Result

Pandas: IF value in dataframe1...THEN decrease value in dataframe2

is anyone familiar with if...conditions in pandas and can help me with a petite question for a beginner?
right now I have this:
tmy_data.loc[tmy_data['elevation of sun'] <= 10, 'DNI'] = 0
But instead of setting the'DNI' to zero when 'elevation of sun' is less then 10, I want it to decrease to 80%
Probably its not that complicated...but I still have no idea 🤓 my try just ended in decreasing the whole dataframe instead of the single value
If you want to save to the existing column 'DNI'
tmy_data.loc[tmy_data['elevation of sun'] <= 10, 'DNI'] = tmy_data['DNI']*0.8
If you want to save to a new column 'DNI_new'
tmy_data.loc[tmy_data['elevation of sun'] <= 10, 'DNI_new'] = tmy_data['DNI']*0.8

Reportviewer VB.NET about Switch Expression

Hello everyone can anyone correct my codes in rdlc tables
i have 1 tables and on that table there was a Field!ans1 that was computing for the average of the column(RED CIRCLE in IMAGE) then i want that average to filter to an if statement to identify if that average is Agree , disagree or Stronglyagree(BLACK CIRCLE IN THE IMAGE)
Here's the Picture of my RDLC Table
the Black Circle is the If Statement that will identify if the Average Below in the Red Circle if is Agree,Disagree,or Strongly Agree
but i am having a problem because the statement always stock on Disagree even its value is 3
// Here is my Code in the Black Circle in the IMAGE
=Switch(Fields!ans1.Value < 1, "Strongly Disagree ",
Fields!ans1.Value > 2, " Disagree",
Fields!ans1.Value > 3, "Agree",
Fields!ans1.Value > 4, "Strongly Agree"
)
//Here is the Code in the RedCircle
=Avg(CDbl(Fields!ans1.Value))
Remember that a switch statement of any kind is evaluated top-down. Is 3.00 greater than 2? Yes it is, so the result is " Disagree" (why you haven't noticed and removed that rogue space, I don't know). If you are going to compare using the 'greater than' operator then you need to compare the largest value first this:
=Switch(Fields!ans1.Value < 1, "Strongly Disagree",
Fields!ans1.Value > 4, "Strongly Agree",
Fields!ans1.Value > 3, "Agree",
Fields!ans1.Value > 2, "Disagree"
)
should work. That's just basic logic that you should have learned in maths class. Note that I have removed that rogue space too.
By the way, that is still going to ignore any values in the range 1.0 - 2.0.

Anyone feel like a Gematria numeric challenge in EXCEL VBA?

To explain: I’m in EXCEL and need a genius formula in VBA, where each letter in the alphabet (except j) is given a SPECIFIC numeric value (as listed below), so that as you type LETTERS in one cell, the SUM OF THE NUMERIC VALUES appear in the cell next to it.
a=1 b=2 c=600 d=4 e=5 f=500 g=3 h=8 i=10
k=20 l=30 m=40 n=50 o=70 p=80 q=9 r=100 s=200
t=300 u=400 v=200 w=800 x=60 y=700 z=7
(Note: It should also apply to CAPS and a space should count zero)
e.g: If I type the words lady asks help in cell A1, the value 1279 should appear in cell B1
(Seeing that l=30, a=1, d=4, y=700, a=1, s=200, k=20, s=200, h=8, e=5, l=30, p=80)
The same formula should apply to the rest of Columns A and B.
In case it’s important, I need it for Greek Gematria. As I type “abc” on the keyboard, the Greek letters “αβχ” appear on the screen (by use of the Tyndale House keyboard code). Each Greek letter has a set numeric value, confirming numeric patterns found in Greek Bible Texts.
I’ve found fixed programs using Greek Gematria (e.g. DAVAR4), but none are editable text and I don’t know how to get into their ‘brains’ to transfer it to EXCEL. Frankly, I’m really clueless when it comes to programming and don’t even know if what I’m asking is possible. Local programmers referred me to Stack Overflow, so ANY help or directive would be much appreciated!
I looked at this question & answer, asked Jul 7 '14 by data_garden, but alas, I’m a dummy!
Please say if any more info is needed. Thanks
You're in luck. There are votes for this to be closed as you've made no apparent effort to write the code yourself. I've written something similar myself recently so all that was needed was to replace the array with your scoring system and it is below:
Function gem(txt As String) As Long
gem = 0
Dim i As Long, c As Integer
Dim arr()
arr = Array(0, 1, 2, 600, 4, 5, 500, 3, 8, 10, 0, 20, 30, 40, 50, 70, 80, 9, 100, 200, 300, 400, 200, 800, 60, 700, 7)
For i = 1 To Len(txt)
c = Asc(Mid(UCase(txt), i, 1)) - 64
If c > 0 And c <= 26 Then gem = gem + arr(c)
Next
End Function

How to floor a number in sql based on a range

I would like to know if there is a function or some sort of way to round a number to lowest whole value. Something like floor, but to a specified increment like 10. So for example:
0.766,5.0883, 9, 9.9999 would all be floored to 0
11.84848, 15.84763, 19.999 would all be floored to 10
etc...
I'm basically looking to fit numbers in the ranges of 0, 10, 20, 30, etc
Can I also do it with different ranges? For example 0, 100, 200, 300, etc
Thank you.
You can do this with arithmetic and floor():
select 10*floor(val / 10)
You can replace the 10s with whatever value you want.