Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

Exluding data in script

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

 

 

WeekCountryHostName
31FPM1
31FPM2
31FLAB
31NPM3
31NPM4
31NLAB2
31SFRE2P
31SHY2P
31SLAB3P
31SLAB4P
1 Solution

Accepted Solutions
bharani8
Creator III
Creator III

20 Replies
balar025
Creator III
Creator III

Hi Stefan,

Can you please provide your expected output?

-Ravi

Anil_Babu_Samineni

If you select "S" then your report should like below? or please provide sample output

Week          Country            HostName

31                    S                    FRE2P

31                    S                    HY2P

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
effinty2112
Master
Master

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

balar025
Creator III
Creator III

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:

FLAB31
FPM131
FPM231
LABLAB3P31
LABLAB4P31
NLAB231
NPM331
NPM431
SFRE2P31
SHY2P31
stekol61
Creator
Creator
Author

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

PrashantSangle

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

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
effinty2112
Master
Master

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

bharani8
Creator III
Creator III

Here you go... Let me know this is what u were looking for?

balar025
Creator III
Creator III

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;