is there any filter can be used to skip rows that contains specific column ?
eg
name price invalid
r1 a 10
r2 b 5 1
r3 c 20
i just want row without invalid column (r1, r3)
i tried SingleColumnValueFilter but it always skip row when the column is missing
You can try this.. Use the same SingleColumnValue filter and and compare with a value that can never be set to that column, like if you are planning to store integer have a comparision with charecter!
SingleColumnValueFilter('ColumnFamily','Qualifier',!=,'binary:x',false,true)
Let me know if this works for you!
Related
In SSAS, I wanted to create a measure that counts the number of rows which the column values contains a specific string.
eg. table
|Id|item
|1|greenapple
|2|blueapple2
|3|yellowapple
|4|purplegrape
search for "apple".
i want the measure return 3.
how should i write the DAX expression?
thanks.
Step 1 first add a column in your table
AppleFlag := if(SEARCH("apple",Table1[Name],1,0)>0,1,0)
Step 2 then create Measure
Apple Count := SUM(Table1[AppleFlag])
I have a 15-digit number that needs to be stored in an Oracle table either as a number or as a text.
Will I be able to select records from the table based on the field ("Positions 1 thru 11" + "Position 13")?
Example: If the data is 123456789012345, I need to select rows from the table to extract all rows that contain value "123456789013" in that field.
Can an index be created in Oracle to ensure the above query performs as good as a normal select query on the entire data field.
If you are storing the column in text then something like this should solve your problem. Use the first if you need to query separately otherwise if you want to query on first eleven and thirteenth use the last example.
create index ix_firsteleven on TABLE (substr(COL, 1, 11))
create index ix_thrirteenth on TABLE (substr(COL, 13, 1))
or
create index ix_concatstr on TABLE (substr(COL, 1, 11) || substr(col_name, 13, 1))
I have the following situation:
column 1 column 2 column 3
A 1 1
A 1 2
B 3 4
B 3 5
I need to color my letters when the value in column 2 never occurs in column 3. But I need to color all my letters. Does anyone know how to write a case statement for this?
So I'll explain my example: I dont't need to color the letter A because there is a match between column 2 and 3 and the first row.
I do need to color my B's because there is never a match between columns 2 and 3.
I already tried this:
count(distinct(case when "Column 2" != "Column 3" then 1 else 0 end))
but this gives a result for each row and I need a result for the total package.
Thanks!
You can approach this as following:
Create a logical column on your analysis that does a case statement that returns 1 or 0 depending if the values of column2 and column3 are the same (pretty much like the case-when that you provided on your answer but without the count distinct).
Wrap that case statement with a MAX grouped by your column1. This will give you either a consistent 1 or 0 across all your different values of column1. You can use this value for your conditional formatting. The key here is to use the aggregated function with the group by.
You have here some oracle documentation on how to use the logical SQL group by.
Hope that helps! Good luck!
I have the following table:
date c1 c2 ... cn
01/01 2 3 ... 4
01/02 ...
01/03 ...
What is the easiest way to filter out the rows where all except the date column have no value? (in this example, the rows with date 01/02 and 01/03)
The easiest way is to setup an input component and change its schema a bit by saying in the schema definition that a value is mandatory, and these records should be ignored
I am building stacked column flash chart on my query. I would like to split values in column for different locations. For argument sake I have 5 ids in location 41, 3 ids in location 21, 8 ids in location 1
select
'' link,
To_Char(ENQUIRED_DATE,'MON-YY') label,
count(decode(location_id,41,id,0)) "location1",
count(decode(location_id,21,id,0)) "location2",
count(decode(location_id,1,id,0)) "location3"
from "my_table"
where
some_conditions = 'Y';
as a result of this query Apex is creating stacked column with three separate parts( hurray!), however it instead of having values 5,3 and 8, it returns three regions 16,16,16. ( 16 = 5 +3+8).
So obviously Apex is going through all decode conditions and adding all values.
I am trying to achieve something described in this
article
Apex doesn't appear to be doing anything funky, you'd get the same result running that query through SQL*Plus. When you do:
count(decode(location_id,41,id,0)) "location1",
.. then the count gets incremented for every row - it doesn't matter which column you include, and the zero is just treated as any fixed value. I think you meant to use sum:
sum(decode(location_id,41,1,0)) "location1",
Here each row is assigned either zero or one, and summing those gives you the number that got one, which is the number that had the specified id value.
Personally I'd generally use caseover decode, but the result is the same:
sum(case when location_id = 41 then 1 else 0 end) "location1",