Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a fact table containing patient data. For example, patient is treated for Disease A , Disease B or combination AB. A patient might have multiple entries in a fact table among different Disease group. Now, when I sum on patient for an individual group I get the total from all three groups. How can I tell QV to do a distinct on a patient. If patient has already included in a count for one group DONT count it another time.
Please let me know if you need additional info.
I'm not sure I understand the question.
If you don't have disease as a dimension in your chart, count(distinct patient) will only count the patients once. If you DO have disease as a dimension in your chart, WHICH disease did you want to include the patient under if they're been treated for multiple diseases? QlikView isn't making the decision for you, which is why you'll see the patient counted under each disease. However, if you do a total for the diseases, it will then count correctly again (unless you select sum of rows).
You can use set expressions to achieve this:
count({<disease={'A'}>} patient)
How would you write the following SQL statement as a QV expression. My fact table is MONTH_PTNT_CNT which has data at regimen level(a lowest regimen level = RGMN_NBR). Another table is REGIMEN_GRP table which states what regimen belongs to which group. It is highly likely that a regimen can belong to more than one regimen_group Or you can say that some regimen_nbr will share parents. In SQL you can easily identify by using IN keyword as stated in the query.
select
sum(TOT_PTNT_CNT) from MONTH_PTNT_CNT where s_gid=21