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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count inside only function

Hi,

Is it possible to incorporate count function inside only function. if not how can i write the below expression.

only({<temp_batch_id={'$(v_module1)'}>}if(count({<result_err_flag={'E'}>}result_err_flag)>0,'E',

if(count({<result_err_flag={'W'}>}result_err_flag)>0,'W',

if(IsNull(result_err_flag),'P'))))

sincerely,

Labels (1)
10 Replies
Anonymous
Not applicable
Author

Thanks Anil. Its working now. below is my complete expression now.

if(Value=1,if(count({$<result_err_flag={'E'},temp_batch_id={'$(v_module1)'}>}result_err_flag)>0,'E',

if(count({$<result_err_flag={'W'},temp_batch_id={'$(v_module1)'}>}result_err_flag)>0,'W',

only({<temp_batch_id={'$(v_module1)'}>}if(IsNull(result_err_flag),'P')))),

if(Value=2,if(count({<result_err_flag={'E'},temp_batch_id={'$(v_module1)','$(v_module2)','$(v_module3)'}>}result_err_flag)>0,'E',

if(count({<result_err_flag={'W'},temp_batch_id={'$(v_module1)','$(v_module2)','$(v_module3)'}>}result_err_flag)>0,'W',

only({<temp_batch_id={'$(v_module1)','$(v_module2)','$(v_module3)'}>}if(IsNull(result_err_flag),'P')))),

if(Value=3,if(count({<result_err_flag={'E'},temp_batch_id={'$(v_module1)','$(v_module2)','$(v_module3)','$(v_module4)','$(v_module5)'}>}result_err_flag)>0,'E',

if(count({<result_err_flag={'W'},temp_batch_id={'$(v_module1)','$(v_module2)','$(v_module3)','$(v_module4)','$(v_module5)'}>}result_err_flag)>0,'W',

only({<temp_batch_id={'$(v_module1)','$(v_module2)','$(v_module3)','$(v_module4)','$(v_module5)'}>}if(IsNull(result_err_flag),'P')))),

if(count({<result_err_flag={'E'}>}result_err_flag)>0,'E',

if(count({<result_err_flag={'W'}>}result_err_flag)>0,'W',

if(IsNull(result_err_flag),'P'))))))

v_module variables are the last 5 temp_batch_id.