Highlighted
Absent Member.. Absent Member..
Absent Member..
382 views

Link command

Jump to solution

Hi experts,

 

we have a requirement of querying only the 2 type of subtypes from device table on selecting affected.item from any of the tables.

 

Link : probsummary

affected.item

$query="subtype="\Service1\" or subtyp=\"Service2\""" 

 

 

The above query doesnt filter the values only for those two subtypes.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Link command

Jump to solution

Why do you do second "else if"? What do you mean under single line query?

Try this one

if (not (null(affected.item in $File))) then $query="logical.name#\""+affected.item in $File+"\""

if (not (null(affected.item in $File))) then ($query+=(" and (subtype=\"Service1\" or subtype=\"Service2\")")) else ($query="subtype=\"Service1\" or subtype=\"Service2\"")

 

I am writing it without system so have not checked

 

 

View solution in original post

9 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Link command

Jump to solution

Hello,

$query="subtype=\"Service1\" or subtype=\"Service2\"" 

Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Link command

Jump to solution

Hi Vadim,

 

It doesnt work...

 

tried 

 

if ($fill.skip.master=true) then ($fill.skip=true;cleanup($fill.skip.master))
$query=subtype=\"Service1\" or subtype=\"Service2\""
if (not (null(affected.item in $File))) then $query+=(" and logical.name#\""+affected.item in $File+"\"")

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Link command

Jump to solution

Hello

You missed double commas

 

$query="subtype=\"Service1\" or subtype=\"Service2\""

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Link command

Jump to solution

Also are you sure that this combination must give any result? You have services in the system which have a subtype ( btw check the name of the field)  Service1  or Service2 and you have inputed correct value in the affected.service fields in the current record or it is empty?

 

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Link command

Jump to solution

Hi Vaadim,

 

We have 2  subtypes " Service 1 " and Service 2" under subtype of ci table..

 

In current record the list populates all the values through by giving search string.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Link command

Jump to solution

BTW,

 

I get the values in case if populate the values indepentely.. instead of joining them using "Or " statement

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Link command

Jump to solution

Can you try then to put the expression in () so or will go together.

 

$query="(subtype=\"Service1\" or subtype=\"Service2\")"

 

Also you can try to change the place of query, first make the one which check the starting and then go with or statment

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Link command

Jump to solution

Hi VAdim.

 

Your command worked for the single line query ..

 

However for incidents we have .

 

 

 

Original :

 

if (not  (null(affected.item in $File))) then ($query=$query+" and logical.name#\""+affected.item in $File+"\" and subtype=\"Service1\"") else if (not  (null($query))) then ($query=$query+" and subtype=\"Service1\" and istatus~=\"Retired/Consumed\"") else ($query="subtype=\"Service1\"")

 

Modified:
if (not (null(affected.item in $File))) then ($query=$query+" and logical.name#\""+affected.item in $File+"\" and "(subtype=\"Service1\" or subtype=\"Service2\")") else if (not (null($query))) then ($query=$query+" and (subtype=\"Service1\" or subtype=\"Service2\"") else ($query="(subtype=\"Service1\" or subtype=\"Service2\")")

 

Howver the above one doesnt work ...

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Link command

Jump to solution

Why do you do second "else if"? What do you mean under single line query?

Try this one

if (not (null(affected.item in $File))) then $query="logical.name#\""+affected.item in $File+"\""

if (not (null(affected.item in $File))) then ($query+=(" and (subtype=\"Service1\" or subtype=\"Service2\")")) else ($query="subtype=\"Service1\" or subtype=\"Service2\"")

 

I am writing it without system so have not checked

 

 

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.