Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I wanted to add an expression in the search object.
Prescriber | Flag |
---|---|
P1 | 1 |
P2 | 0 |
P3 | 1 |
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?
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
];
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
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.
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
];
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.
The expressions work fine in the front-end for me.
Searching on =Count(if(Flag=1, Prescriber))
Returns P1 & P3
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.
Javier,
This works.
But let me know if you have some other way, except adding in the script.
Thanks
Kaushik,
This will be very cumbersome if we have a large number of Prescribers in the list.
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.