Discussion board where members can get started with Qlik Sense.
Hello Qlik Experts,
I’ve an existing script that is loading data, when I add one more condition generates error. Can anyone help me with the nested condition please? The data input fields are:
Currently the script I’ve is:
if (policy_type = 'DDD' and policy_eff< '1/1/2019' and pfl <> 'N' and livecount > 50 and premium>0, premium*.85,
if (policy_type = 'DDD' and policy_eff< '1/1/2019' and pfl<>'N' and livecount <= 50 and premium>0, premium*.75,
if (policy_type = 'DDD' and policy_eff>= '1/1/2019' and pfl<>'N' and premium>0, premium*.92, 0))) as pfl_premium
I want to populate a calculated field pfl_premium by loading the records that have fields:
and generate/ populate a field value pfl_premium for:
pfl_premium: premium * .70
pfl_premium: premium * .80
pfl_premium: premium * .90 (doesn’t matter whatever the livecount)
anything else, populate 0, for example, if premium is -75, populate 0 in pfl_premium, if policy_type = anything but DDD populate 0, if pfl = ‘N’ populate 0 in pfl_premium.
Would you please check my script and help me as I got different result comparing my excel calculation?
I sincerely appreciate your kind help. Thank you very much!
ur loading data from QVD or database
if you loading from database try to use db functions
I'm loading from QVD. It gives me correct sum for 2018 conditions but not 2019 😞Regards,