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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Including OR logic

Hello Again,

I am trying to create a field that will display selections from 2 other loaded fields [Prim Diag] and [Sec Diag]. If this were a report ran in Crystal the logic would be to include info for Diag Code X01.13 where listed in [Prim Diag] or [Sec Diag]. With the current table I have in QV it is possible to get this info by setting 2 separate filters (obviously), but for user ease I would like to be done with 1 step. Does anyone know how to do this? Please let me know if you need an example or attachment.

Thank you,

EK

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Not applicable
Author

pl attach sample application

Not applicable
Author

Right so here if my end user wanted to find all accts for V42.7 they would need to search the code in [Prim Diag] to find accts 5000-5003. Then they would need to search the code in [Sec Diag] to find accts 5005-5007. I would like a way where the can search for this code once and return all valid accts. Hence my thought of using an OR function..

Not applicable
Author

Somebody might come up with a better method than this, but here goes (I can't modify your example tonight as I'm not near a pc).

Create a data island in your data model that is a field containing the distinct values from both [prim diag] and [sec diag]. Use this field in your front end for the user to select against.

Then, in your chart you need to use a set analysis expression that implies an OR.

Lets assume you want sum of sales in your chart, your expression would be:

Sum({$<[prim diag]={[selected field name]}>}sales)+

Sum({$<[sec diag]={[selected field name]}>}sales)

The syntax here might not be precise as I can't check it but if you can't make it work drop a reply in and I'll take a look in the morning.

Good luck

Not applicable
Author

USe:

 

=

[Sec Diag] &'--'& [Prim Diag]

Not applicable
Author

Although a concatenation would include the code in a search I need it to display only that diag code. I could concatenate and rename the tables to include both options but that is would take a lot of reloading of all my files. An if or function should be able to grab the right data I just havn't seen an example I can use.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Ahh beautiful! Thank you so much!!