Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
So I am using an ApplyMap and the results are correct. ... sort of.
My resultant table should only show X,Y,Z and not have A and B also.
My group has more names than listed below but only those 3 names below are using the ApplyMap functionality. The other names should then be ignored in my resultant table.
In my resultant table, for my dimension, I am using
if(Service = 'A*', NULL(), Service)
This is the important part, I need the wildcard A*, rather than say
if(Service = 'A, AB, ABC, ABCD', NULL(), Service)
Resultant table:
Service | Number |
---|---|
X | 1 |
Y | 2 |
Z | 3 |
A | 4 |
AB | 5 |
ABC | 7 |
ABCD | 8 |
Mapping table
Group | Service |
---|---|
John | X |
Mary | Y |
Rob | Z |
Try like this
Temp:
Mapping LOAD
Service,
Group
from table
where Service='X' or Service='Y' or Service='Z' ;
Resultant_Table:
LOAD
Service,
Number,
applymap('Temp',Service,null()) as Group
from table;
//since the mapping table has only the values for X ,Y and Z rest for the values will return as null()
Hope this helps you
Your question does not show the applymap statement you are using. Can you post your applymap statement?
What is the source data look like. I think I am not able to understand the complete issue here.
Try like this
Temp:
Mapping LOAD
Service,
Group
from table
where Service='X' or Service='Y' or Service='Z' ;
Resultant_Table:
LOAD
Service,
Number,
applymap('Temp',Service,null()) as Group
from table;
//since the mapping table has only the values for X ,Y and Z rest for the values will return as null()
Hope this helps you
ApplyMap('MapServiceToGroup', Group) as Service
I am getting the correct results but at the same time, I only want the X Y and Z to show.
Attached is a dummy app, The first table shows my result, the second shows my Wildcard if statement
Have you attached the correct qvw? I am only seeing one table
did you try my suggestion (please check my last post )
Attached again
Try like this
Try like this
Temp:
Mapping LOAD
Service,
Group
from table
where Service='X' or Service='Y' or Service='Z' ;
Resultant_Table:
LOAD
Service,
Number,
applymap('Temp',Service,null()) as Group
from table;
//since the mapping table has only the values for X ,Y and Z rest for the values will return as null()
This is exactly what I needed. I didn't have the NULL() at the end of my ApplyMap() function.
Thanks