Note that there are some explanatory texts on larger screens.

plurals
  1. POUnexpected result from mapping function
    primarykey
    data
    text
    <p>My significant other uses Crystal Reports in the course of her duties, and has come to me for assistance. She has written a mapping function as shown below and is surprised that gets the fallout value when a client has multiple cards (see diagram). </p> <p><img src="https://i.stack.imgur.com/9yKfD.png" alt="diagram"></p> <p>In this model, when a client has a care visit, the client's card is supposed to be indicated in the client visit record for government reporting purposes. While the card id is not conceptually optional, it is quite possible that the card is not on file at the time the visit details are being logged, so their system allows this to be left temporarily unfilled. This state is represented by the "no card" condition in the mapping function below.</p> <p>Unsatisfied with my response that this means none of her conditions is met, she has asked me to post her appeal for help.</p> <p>Below is the Crystal Basic code from her mapping function. She is aware that there is an unhandled case in the last condition, and in that case a blank would be displayed, which is not the observed behaviour. The names from the diagram don't match the names in the mapping function code because the diagram is my synthesis of much arm-waving and explanation, whereas the code is pasted directly from the report and contains actual field names.</p> <pre><code>if ({awt_temp.Service_code} = "DOM") and ({Card_Type.Card_Type_ID} = 21) then {Card_Holder.Card_No} else if ({awt_temp.Service_code} = "MANT") and ({Card_Type.Card_Type_ID} = 25) then {Card_Holder.Card_No} else if ({awt_temp.Service_code} = "PC") and ({Card_Type.Card_Type_ID} = 22) then {Card_Holder.Card_No} else if ({awt_temp.Service_code} = "RES") and ({Card_Type.Card_Type_ID} = 24) then {Card_Holder.Card_No} else if ({awt_temp.Service_code} = "SOC") and ({Card_Type.Card_Type_ID} = 23) then {Card_Holder.Card_No} else if not ({Card_Type.Description} startswith "vhc") then "no card" </code></pre> <p>There is no point mentioning that the mapping function would best be handled with a join to a lookup table. She's not in a position to redesign the schema.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload