Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I'm loading the dimentions below and want to present them in a report/graph.
When I select e.g. Country='S' I want to exclude the Hosts containg 'LAB'.
I also need to have the possibility to see the LAB-Hosts. E.g. by usiga a Dummy 'Country' ='LAB'
Not sure what's the best way to solve this,. In the scipt or in the report
Week | Country | HostName |
31 | F | PM1 |
31 | F | PM2 |
31 | F | LAB |
31 | N | PM3 |
31 | N | PM4 |
31 | N | LAB2 |
31 | S | FRE2P |
31 | S | HY2P |
31 | S | LAB3P |
31 | S | LAB4P |
Here you go..
Hi Stefan,
Can you please provide your expected output?
-Ravi
If you select "S" then your report should like below? or please provide sample output
Week Country HostName
31 S FRE2P
31 S HY2P
Hi Stefan,
For the first question try:
{$-<Country = {'S'}, HostName = {'LAB*'}>}
as a set modifier in your expression.
I don't quite understand the second problem, can you explain a bit further.
cheers
Andrew
as i understand, can you try below script?
Data:
Load * Inline
[
Week, Country, HostName
31, F, PM1
31, F, PM2
31, F, LAB
31, N, PM3
31, N, PM4
31,N, LAB2
31, S, FRE2P
31, S, HY2P
31, S, LAB3P
31, S, LAB4P
];
//QUALIFY *;
Data_New:
Load *,1 as Flag
Resident Data
where not (Country='S' and WildMatch(HostName,'LAB*'));
Concatenate
Load Week, 'LAB' as Country, HostName ,2 as Flag
Resident Data
where (Country='S' and WildMatch(HostName,'LAB*'));
Drop table Data;
Output:
F | LAB | 31 |
F | PM1 | 31 |
F | PM2 | 31 |
LAB | LAB3P | 31 |
LAB | LAB4P | 31 |
N | LAB2 | 31 |
N | PM3 | 31 |
N | PM4 | 31 |
S | FRE2P | 31 |
S | HY2P | 31 |
Hi!
If I select "S" the report should look like this:
Week Country HostName
31 S FRE2P
31 S HY2P
If I select the "Dummy" Country 'LAB' I want to see all hosts containg the name 'LAB'
Whare to i use the set modifier in my?expression
What about Country 'N'?? LAB2 should display in country N???
well You can create new field in script like
if(Country='S' and wildmatch(HostName,'LAB*'),'LAB',Country) as newCountry
Use newCountry field in front end instead of Country.
Regards,
Prashant
Hi Stefan,
I think there are better ways to see all your hosts with name beginning LAB.
Data:
Load
*,
If(WildMatch(HostName,'LAB*'),'LAB','Not LAB') as IsItLAB?;
LOAD * INLINE [
Week, Country, HostName
31, F, PM1
31, F, PM2
31, F, LAB
31, N, PM3
31, N, PM4
31, N, LAB2
31, S, FRE2P
31, S, HY2P
31, S, LAB3P
31, S, LAB4P
];
Or why not just a searchbox on the field HostName?
cheers
Andrew
Here you go... Let me know this is what u were looking for?
is it not helpful?
Data:
Load * Inline
[
Week, Country, HostName
31, F, PM1
31, F, PM2
31, F, LAB
31, N, PM3
31, N, PM4
31,N, LAB2
31, S, FRE2P
31, S, HY2P
31, S, LAB3P
31, S, LAB4P
];
//QUALIFY *;
Data_New:
Load *,1 as Flag
Resident Data
where not (Country='S' and WildMatch(HostName,'LAB*'));
Concatenate
Load Week, 'LAB' as Country, HostName ,2 as Flag
Resident Data
where (Country='S' and WildMatch(HostName,'LAB*'));
Drop table Data;