Grafana set value by field - grafana

So, I have some probleam. Please help.
Trying to develop state timeline in grafana and after transform(group by) I have table.
I need set value = 0, when Status == "Error" and value = 1 when Status == "Success"
How I can do this?
Help with find answer)

Related

how to change the date format in talend

I have two scenario's,which I couldn't able to solve.
PLZ help me.
Scenario 1:
I've two files Source_1_table(Excel file),Source_2_table(Excel File).
Attached screenshot
I want to compare the source_1 date to source_2 date.
If the source_1 date is matching with source_2 date then the status should be as "Y" if not match then the status should be "N".
Here I am trying with this code row1.date.equals(row2.date)?"Y":"N"
Note:both columns are string data type.
Scenario_2:
Here source_1 SAL column have a null value.and source SAL column have a VALUE.
While I am trying to compare the source_1 sal value with source_2 sal value getting null pointerException.
I am trying with this code relation.Is(source_2.sal)?" ":source_2.sal.equals(source_1.sal)?"Y":"N"
I want to replace a value with empty space or "empty" in null value.
Please look at this snapshot.
Scenario 1: “ row1.Date.equals(row2.Date)?"Y":"N"” is working if both Source 1 & Source 2 contain dates as string.
Scenario 2: To avoid the Null Pointer Exception, check for null values before comparing Source 1 and source data. Please try the expression below:
(row2.SAL == null || row2.SAL == ("")) ? "" : row1.SAL == row2.SAL ? "Y" :"N"

Tableau - Error when COUNT boolean T/F

My goal here is to count the # of True, False and NULL per day using my boolean calculation. Next step would be to calculate the percentage of each T, F, N with overall day.
Below is the visualization I would like to achieve but instead of blue dots, I would need the count of them in number.
Initially, I tried
IF [boolean] THEN 1 ELSE 0 END
But only changing from True to 1, False to 0 and missing the NULL - not counting:
I also tried different Calculated Fields to get the count of it but always getting the same error:
SUM(IF [Field]=TRUE then 1 else 0 end)
COUNT(IF [Field]=TRUE then [ID] end)
ERROR:
Could someone please assist me with a Calculate Field or any other solution where I could get a count of T, F, and NULL that would also assist me with the percentage?
Thank you
You're working too hard.
Just put SUM(Number of Records) on one shelf with DAY(Disconnected ...) on another, with the Boolean field that classifies data rows as > 0 or not on some other shelf, such as Color. No need for a table calc.
Here is an image of a solution posted at https://community.tableau.com/message/601862#601862

Jasper Report checking if a date parameter is entered

So in my report I want to check if the user enters a from_date and a to_date. It should also check if the entered range is lower than ten. If not I display an error with a print when expression. Currently I have:
OR(DAYS($P{P_DATE_FROM},$P{P_DATE_TO}) > 10,$P{P_DATE_FROM} == null,$P{P_DATE_TO} == null)
I also tried this:
OR(DAYS($P{P_DATE_FROM},$P{P_DATE_TO}) > 10,DAYS($P{P_DATE_FROM},$P{P_DATE_TO}) == null)
When I use the second expression (DAYS(...) == null) alone it works when I do not enter a date. When I use the first one alone it also works if the user enters a date range higher than ten.
I tried all different constelations but nothing worked. I tried to convert the date to a util.Date, because the parameters are of type sql.Date, but nothing worked. Any ideas on how to write this print when expression?
I just found the answer to my question after days of testing.
$P{P_DATE_FROM} == null || $P{P_DATE_TO} == null || DAYS($P{P_DATE_FROM},$P{P_DATE_TO}) > 10

OrientDB Wrong search result

Seem that OrientDB doesn't return the correct result for the simple search.
I created a class node item with 2 properties id and flag
id: type STRING, index: UNIQUE
flag: type DECIMAL
flag can be set by 1, 0, or null value.
I use the query below to get all item which has flag is 1
`select from item where flag = 1`
But the query returns nothing.
Note: I have tested on 2.2.7 and 2.2.10, and seem that this issue only occurs if flag was defined in schema before feeding data.
Is it bug?
UPDATED: Added sample database. Get it here
If you use select from item where 1 = flag it works.
For your query select from item where flag = 1 could you open an issue on github attaching your database ?
Tested on 2.2.10, no problems here:
create class item extends v
create property item.id STRING
create property item.flag DECIMAL
insert into item(id,flag) values ("id1",1)
select from item where flag = 1
Also added UNIQUE index on id from studio -> schema.
Output:

Conditionally sum in variable expression in total column

I'm building a report in iReport 5.0.4, so far I have a crosstab table as follows
What I'm trying to do in Total 4 is having a total of sum3Measure but only of types "X" or "Y" (defined by the value in $V{col1}). I tried in Text Field Expression this:
$V{col1}.equals("X") || $V{col1}.equals("Y") ? $V{sum3Measure } : 0
but it returns always null. I did:
$V{col1}.equals("X") ? $V{sum3Measure } : 0
to test if the operator || is not valid but it returns null as well.
I used $V{row1} instead of $V{col1} to test it wasn't a problem different from the expression, it did the sum.
All measures are defined with Calculation type Sum
Is it possible to do what I want? if not, is there a workaround I can try?
Any help will be appreciated, if you need more info just let me know.