Change the background of Text dynamically in tableau - data-science

Is there a way we could change , the color of the background in tableau dynamically.
I have just used the Text Object , in text-Object I have taken name and < parameter >%.
I would like to change color based on parameter value .
Like less than 90% be Red and more than it be Green.
In image-below , I have hardcoded the values .
so , i want it in live that hence dynamic

Related

Colors[4] not showing color selection on Front Panel

I am trying to set the color of an indicator to different colors based on different values, like 1 = red, 2 = blue etc. Using guidance from a Youtube video (accessible using this link: https://www.youtube.com/watch?v=czUmPQmKmGU), I have created a Colors[4] control for the indicator I have after changing it to the "write" function.
The Problem on the front panel is that I am getting a control with numbers instead of a color box where I can select the colors to show based on the value. This was the control I got instead.
This is the control I am trying to achieve (below):
Is there any way that I can get the color box on my control instead of the number controls? I am not sure if it can be changed through a control on the front panel or something but what I have tried so far keeps leading me back to this problem.
Any advice is much appreciated
A color box control is just a U32 number (three bytes for RGB and one which is always 0), which is why that's what you get.
There is a right click plugin which adds a replace with color box option directly to the right click menu of unsigned 32 bit numbers, but I don't remember if it ships with LV or not.
If you don't have that, you can always just right click the indicator inside the cluster, select replace and navigate the palettes to find the color box. You can also copy a color box and then select the indicator and paste, which replaces the selected control.
The color[4] is actually an array of 4 colors (UInt32 as Yair said), that define 2 color gradients, one for the 'Off' state, and the other for the 'On' State of the control.
If you want to set the control's color, you will have to define all 4 of them.

How to change the text colour of a date in CalenderView in Kotlin

how do you change the text colour of a date in a CalendarView in android? Specifically I want to know how to achieve this programmatically as all the examples I've seen so far are based on XML but I would like to achieve this dynamically. For example I am using a database which has a date and field that indicates true or false. When it's true I want the text colour of that date to be different.
Below is the example I found in XML: https://kotlin-android.com/android-calendarview-tutorial-kotlin/.
I assumed I can just update the dateTextAppearance attribute for CalendarView but I don't think I can assign a value to it.
var calendarActivity: CalendarView = findViewById(R.id.next_month_calendar_view)
println(calendarActivity.dateTextAppearance)
The print statement gets me 16974789, throwing the number into an int to colour converter gets me a bright pinkish colour but the calendar view doesn't have that colour.
So my question is how do you change the text colour of a given date in kotlin programmitically for a CalendarView?

Changing Label's Image According To Variable?

I'm trying to make (using Visual Basic) a rudimentary questionnaire that measures multiple attributes and stores their values in an array and afterwards measures the attributes on a scale of 1 to 10.Now I've had the dumb idea to use a label for every single value of every attribute, and highlighting the right number by changing the label's image to yellow, instead of white(basically making the area behind the number a different color).
Now here's the issue: I can't seem to find out how to change a label's background image with code, which is what I'm asking. (I'm guessing the command should look something like "Label1.image = >image path<")
Pretty simple.
If text = No then
Label.Text = No
Else
Label.Text = Yes
End IF
You just have to change the text value of the label which is .Text = Text you want
And if your trying to show images, you should use the image control in the tool box, not a label

Hide a chart if no data

We are setting a chart on pentaho report designer 5.3 and we want it to hide if no data is returned by the query , lined to that chart .
We have used , the :
=not(isemptydata())
in the visible style expression but it shows
chart_user_no_data_available
on the chart so it is not working .
So how to solve this issue , best regards

SSRS Change cell color depending on SUM value

I am loading a dataset into my report and filling my last column with this expression: =Sum(Fields!ID.Value) and it loads fine, I am trying to put a condition in so when the number is less than 15 for example, the cell color will change to red. I have tried so many different syntax but nothing works... it must be pretty simple...?
The errors I am getting are: The value expression for textbox has scope parameter that is invalid for aggregate
Any help would be good :)
To set the background color Click on the cell and in properties window on your right hand select the BackgroundColor property and then set expression to that property.
Or right click on cell and select TextboxProperties -> Fill and at the start there is option to set the expression for fill color.
You are using the wrong expression the expression should be ,
= IIF(Sum(Fields!ID.Value) < 15,"Red","Transparent")
You can change the Transparent to whatever color you want.Take a look here on how to use expressions.
This shows how you could add a colour range if necessary by using the Color property to set the font colour.
=iif(Sum(Fields!ID.Value) < 15,"Red",iif(Sum(Fields!ID.Value)>50,"Blue","Black"))
To Change the background colour instead you would use the Background colour property.
=iif(Sum(Fields!ID.Value) < 15,"Red", "No Color")
Note that SSRS 2008 "Transaparent" is replaced by "No Color". Whilst transaparent works it gives rise to this warning message.
[rsInvalidColor] The value of the BackgroundColor property for the textbox ‘textbox22’ is “Transparent”, which is not a valid BackgroundColor.
As an alternative to these use "#FFFFFF" instead of Transaparent or No Color