Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chhavi376
Creator II
Creator II

Search Object

Hi,

I wanted to add an expression in the search object.

PrescriberFlag
P11
P20
P31

I want that i should only be able to search the Prescribers with Flag '1' i.e P1 and P2.

is there any way i can do this?

1 Solution

Accepted Solutions
Anonymous
Not applicable

I don't think there's a way to do that directly in the search object, but you could create an extra field 'PrescriberSearch' in your data model and use that extra field in the seach object instead the original 'Prescriber' one:

test:

LOAD

  *,

  if(Flag = 1, Prescriber, Null()) as PrescriberSearch

;

LOAD * Inline [

  Prescriber, Flag

  P1, 1

  P2, 0

  P3, 1

];

View solution in original post

9 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can write the If statements in script and create that flag, like

Load  if(Prescriber = P1 and Prescriber ='P2,1,0) as Flag

From xyx;

Then you can create a listbox of Flag field and make a selection.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Colin-Albert

This blog has details on the expression search  The Expression Search which you can use on a listbox for Prescriber.

=Flag=1 should work in your case though you may need to use something like  =Count(If(Flag=1, Prescriber))


These expressions will work in both the listbox search and the search object.

Anonymous
Not applicable

I don't think there's a way to do that directly in the search object, but you could create an extra field 'PrescriberSearch' in your data model and use that extra field in the seach object instead the original 'Prescriber' one:

test:

LOAD

  *,

  if(Flag = 1, Prescriber, Null()) as PrescriberSearch

;

LOAD * Inline [

  Prescriber, Flag

  P1, 1

  P2, 0

  P3, 1

];

chhavi376
Creator II
Creator II
Author

Hi Colin,

Actually i am unable to put any expressions in the search object.

and i was looking for a way except adding it in the script.

Colin-Albert

The expressions work fine in the front-end for me.

Searching on    =Count(if(Flag=1, Prescriber))

Returns P1 & P3

search_test.JPG

chhavi376
Creator II
Creator II
Author

Colin,

You got me wrong.

actually i wanted to add an expression at the backend.

So that if i search 'P2', it does not display in the search list at all.

the end users don't want to search these flagged prescribers in the search object, but wants to see their data in the chart/table.

chhavi376
Creator II
Creator II
Author

Javier,

This works.

But let me know if you have some other way, except adding in the script.

Thanks

chhavi376
Creator II
Creator II
Author

Kaushik,

This will be very cumbersome if we have a large number of Prescribers in the list.

Anonymous
Not applicable

I only know of two ways of accomplishing such behavior.

One is the way I described in my previous post and the other is unchecking the "Include Excluded Values" checkbox in the Presentation tab of the search object properties, filtering by Flag=1 in your document and using set analysis in your chart/table to bypass such filter. But doing so will prevent your users from searching prescribers excluded by other filters in your document so I would advise against it.