Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hii All,
Please tell me how can we use match() function and how it works?
For example :
=Match( M, 'Jan', 'Fev', 'Mar')
Give you : 2 if M = Fev
Give you : 0 if M = Avr
given that there is a field named 'month' in my qvw file and its value are ('Jan','Feb','Mar','Apr' ).
if i create a pivot table which month as its dimension, the expression is below :
match(month,'Jan','Feb','Mar','Apr')
here is the result :
month | result |
Apr | 4 |
Feb | 2 |
Jan | 1 |
Mar | 3 |
is it clear enough?
zhou
You could also use MATCH Function like if(sum(match,Firstfield,Secondfield,1,0)) which will match results between two fields. This is useful when comparing contents of two fields i.e. in a migration situation. If there are any unequal observations they will come out as 0 else 1.
Tormod Hanstad
thanks Zhou Z,
But if i want to match two different things like:
as ur example:
I want to make a pivot table in which dimension is taken as according to codes
Table1
col1 col2 col3 col4
jan 01 march 03
feb 02 april 04
and the result to be shown as:
jan 01
feb 02
march 03
april 04
match(month,'Jan','Feb','Mar','Apr')
The result will be:
month | result |
Apr | 4 |
Feb | 2 |
Jan | 1 |
Mar | 3 |
it the value of the field month do not match any of the searchstring, result will be zero.
nonzero values can be considered as TRUE and zero is FALSE Poornima Shrivastava
i don't get you. pls make it clear.
hi
see attached file
or try this code
test:
LOAD * Inline [
col1, col2, col3, col4
jan, 01, march, 03
feb, 02, april, 04
];
output:
LOAD col1 as month,
col2 as value
Resident test;
join
LOAD col3 as month,
col4 as value
Resident test;
drop Table test;
then output like this
month | value |
jan | 01 |
feb | 02 |
march | 03 |
april | 04 |
i got the answer of previous question, actually i was going wrong side..thanks for help..