If case in Pentaho Report Designer? - pentaho

I have an excel input and it has two filed AB and AB1. Here AB1 contains null value(or blank). My aim is to check that if AB1 is null or blank then result will contains AB. That is:
if AB1 is null or blank then
AB
else
AB1
I tried with formula option in pentaho like this
=IF([AB1]=NULL();[AB];[AB1])
How can I address this issue?

Related

INDEX and Partial MATCH in Sheets

=INDEX(Sheet17!$B$2:$B$50,MATCH(C5,Sheet17!$A$2:$A$50,0))
Short version:
This formula works when C5 is an exact match for text in Sheet 17 Column A, but I want to be able to match part of c5 (a keyword or phrase in C5) to that keyword or phrase in Sheet 17 Column A.
Details:
For my home budget and expense tracking, I'm using INDEX and MATCH to
return a piece of text (a label I use for the expenditure) from Sheet17 Column B
based on matching C5 (the description in my check register)
to a keyword or phrase in Column A Sheet17!$A$2:$A$50
AND IT WORKS when the text in C5 (in this case) is an exact match for the text in the column to look up against Sheet17!$A$2:$A$50
But I want to be able to match PART of C5 to Sheet 17 Column A and return the result
I've tried using wildcards around C5 but that doesn't help.
This works for exact matches between C5 and a keyword or phrase in Sheet 17 Col. A
=INDEX(Sheet17!$B$2:$B$50,MATCH(C5,Sheet17!$A$2:$A$50,0))
When I put wildcards around C5 such as ""&C5&""
I get the error message "Did not find value (the full text of C5) in the MATCH evaluation.
=INDEX(Sheet17!$B$2:$B$50, MATCH(FILTER(Sheet17!$A$2:$A$50,
SEARCH("*"&C5&"*", Sheet17!$A$2:$A$50)), Sheet17!$A$2:$A$50, 0))
_______________________________________________________________
=ARRAYFORMULA(IFERROR(VLOOKUP(REGEXEXTRACT(C3:C,
TEXTJOIN("|", 1, Sheet17!A2:A)), Sheet17!A:B, 2, 0)))
demo spreadsheet

Pivot Table Number Ranges - Novice

I am a complete novice to excel and having my first go with Pivot Tables.
I have sheets with lost of data mostly numeric, these sheets contain up to 80,000 rows and 25 columns.
I am using pivot tables to filter the data and have managed to get it going ok to give me the values I require.
However I would like to now add the ability to break down the filter ranges into numbers with between values.
For example I have one particular column with numbers ranging from -600 to +2450.
I would like to look at values between 35 and 180 for example without having to select multiple values in the filter and then tick every box i require.
Is this possible for a novice (I have no idea what or where VBA is having had a look around
IF it is possible would it then be possible to do the same for columns that contained a certain piece of text
Hope someone can help
Ian
this is how i would do it.
let's say your "one particular column with numbers ranging from -600 to +2450" is column A.
You can set a new column with the formula IF(OR(A*>=35,A*<=180),1,0),
drag the formula to fill the rest of the cells in the new column,
filter the new column for 1 and it should display all the rows where the values are more than 35 and less than 180.
if it doesn't work with the pivot table, try select all the data in the pivot table, copy and paste the data as values to a new sheet.
you can try it for text as well. just if you are searching for "APPLES" in a column A,
use IF(A*="APPLES",1,0) in a new column and filter out 1.
hope this helps.
For ad-hoc analysis, you could right-click on the relevant field header and select Value Filters and Between. This will save ticking/unticking every number in the range.
You can also group your data field. If you e.g. have the following pivot table layout:
Header1 Header2 Data
A AB 1234
AC 2345
AD 3456
B BB 4567
you can select e.g. AB-AC and right-click and Group... the items. This will add another column with the grouped Header2 fields:
Header1 Header2_2 Header2 Data
A Group1 AB 1234
AC 2345
AD AD 3456
B BB BB 4567

VBA Resize Array, 1 Column to 4 Columns

So I copied some data into Excel, but unfortunately for me when I pasted the data the chart format sorta died, so I ended up with a 1 column full of data(Column A). Basically A1 is suppose to be Movie name, A2 is suppose to be in B1(Cost of movie), A3 is suppose to be in C1(How long is the movie), and A4 is suppose to be in D1(Sequel:yes/no). And A5 is suppose to be in A2, A6 in B2, A7 in C2, A8 in D2, A9 in A3, A10 in B3..etc.. Its suppose to be a chart with 4 columns, but everything ended up in column A. Anyone can help me write a VBA code to rewrite the first column back to 4 columns? Thanks in advance.
No need for VBA. In excel, use INDIRECT in the four columns
=indirect("A"&(row()-1)*4+1) | =indirect("A"&(row()-1)*4+2) | ...
=indirect("A"&(row()-1)*4+1) | =indirect("A"&(row()-1)*4+2) | ...
...

LibreOffice populating cells

I have a spreadsheet containing data identifying the depot where a product is stored, the supplier of the product and the manufacturer of said product.
I wish to break this one spreadsheet into four .csv files and import csv files into an already created PostgreSQL db. Typically, depot.csv, product.csv, supplier.csv and manufacturer.csv.
depot.csv has <15 entries, supplier.csv & manufacturer.csv <350 entries each and product.csv < 2,000 entries.
Example of what I want to do.
I have created a list of unique depots in a worksheet called depot.
id name
paris
berlin
london
original spreadsheet data
id Depot depot_id PRODUCT NAME product_id SUPPLIED BY Manufacturer
1 Paris 1 Hand wipes Erenco Chem Group
6 London 3 Scrub Towels Chemicraft Chem Group
7 Berlin 2 WR2 Grease Greasy Bin Chem Group
the column depot_id is populated by using the following formula
=IF(B2=depot.$B$2,depot.$A$2, IF(B2=depot.$B$3,depot.$A$3, IF(B2=depot.$B$4,depot.$A$4, 9999)))
and a worksheet called depot
Now I need a formula to populate product_id but above formula is not sufficient.
Thanks.
Tommy.
This problem is probably best solved by using the vlookup function.
Okay it's working.
Formula looks like this... in cell C2 enter the following
=VLOOKUP(D2,Product.$A$2:$B4586,2,0)
explanation:
D2 = the text being searched for
Product.$A$2:$B$4586 = the search array, in another worksheet, being searched
2, = the value to be posted in cell C2. This is from the column B in the search array. The leftmost column should be the column containing the value searched for.
0 = signifies a unsorted/unordered list.
See http://forum.openoffice.org/en/forum/viewtopic.php?t=46746 for better explanation.
Also http://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_VLOOKUP_function
Thanks to Mauritz for reinforcing my research.
Tommy.

How to find a Particular value in particular range

Here is a example of the sheets, in which I am trying to create a macro with vba.
In the first sheet, there is a value for NAME in D3, which is 25, it can change but number only.
In second sheet, there is table. Where b1,b2, b3, b4 till b13, are name(variable) values from 1 to 13(As in sheet d3, different value). In A1 to a13, there is serial no. from 1 to 13.
In third sheet, there is table.
Where b1,b2, b3, b4 till b13, are name(variale) values from 14 to 26(As in sheet d3, different value). In A1 to a13, there is serial no. from 1 to 13.
So, I want that the macro should check for sheet 1 d3 value in all worksheet, if found it will check for the serial no. against it, put the no. in E6 filed.
Sorry of I've misunderstood your question but it sounds like a vlookup might do the trick rather than the need to write VBA and use the Find method.
If you combine the second and third sheet, so that Column A contains the possible values for NAME in D3, and the Serial Number in Column B, like this.
NAME | Serial
-----|-------
1 | qwerty
2 | bob
... | ...
You can then use a LOOKUP query as follows in E6.
=VLOOKUP($D$6,Sheet2!A:B,2,FALSE)
Hope this helps.