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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitians
Creator III
Creator III

Code for Count Calculation

Dear Users,

I have a scenario where in I want to count the number of sanction accounts for the month,

but if the product is ADDL_LOAN I need to check for Linked Lan if any Lan is found I will club the count with same basically whichever lan is found under  Linked lan of  ADDL_LOAN should not be counted ...

     

SZ_APPLICATION_NODT_DISB_DATESZ_PRODUCT_CODELinked LanSanction Count
AHMHL1600020131-05-2016LAPSORP-1
AHMHL1600020231-05-2016HLSELLERBT-0
AHMHL1600020331-05-2016ADDL_LOANAHMHL160002021
AHMHL1600019631-05-2016HLRDYPURBD-0
AHMHL1600020631-05-2016ADDL_LOANAHMHL160001961
AHMHL1600014423-05-2016LAPSORP-1
AHMHL1600015231-05-2016HLRDYPURBD-0
AHMHL1600020431-05-2016ADDL_LOANAHMHL160001521

Thanks and Reagrds,

Rohit Yadav

1 Solution

Accepted Solutions
Kushal_Chawda

see if below expression helps

=Count({<SZ_APPLICATION_NO=e({<SZ_APPLICATION_NO =p({<SZ_PRODUCT_CODE={'ADDL_LOAN'}>}[Linked Lan])>}SZ_APPLICATION_NO)>}SZ_APPLICATION_NO)

View solution in original post

4 Replies
migueldelval
Specialist
Specialist

Hi Rohit,

If all "linked Lan" has a 0 value, You can use this expreession.

=count(distinct{<[Linked Lan]={"*0*"}>}SZ_APPLICATION_NO)

Right now is ok in your example,

Regards

Miguel del Valle

Kushal_Chawda

see if below expression helps

=Count({<SZ_APPLICATION_NO=e({<SZ_APPLICATION_NO =p({<SZ_PRODUCT_CODE={'ADDL_LOAN'}>}[Linked Lan])>}SZ_APPLICATION_NO)>}SZ_APPLICATION_NO)

rohitians
Creator III
Creator III
Author

Dear Miguel,

Your solution is partially correct the count is not coming right where there is no ADDL_LOAN or linked lan,

also Count for  Lan no  should only be avoided if it comes  in Linked Lan for ADDL_Loan

Request you to help,

Thanks,

Rohit

antoniotiman
Master III
Master III

Try

=count({<SZ_PRODUCT_CODE={'ADDL_LOAN'}>} If(Len(Trim([Linked Lan])) = 0 or [Linked Lan]='-',SZ_PRODUCT_CODE))

Regards,

Antonio