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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahamed_Qlik
Specialist
Specialist

Urgent Need

Hi Guys,

I have following field i need the count of CropCode starting with 'CS only.

For example :  only CS001, CS002, CS003,CS004 so the count should be 4

CropCode
CS001
CS002
CS003
CS004
         1001
         1002

Kindly Help.

Labels (1)
12 Replies
sasiparupudi1
Master III
Master III

=Count({<CropCode={'CS*'}>}CropCode)

Mahamed_Qlik
Specialist
Specialist
Author

Hi,

II tried but it is not working. showing count 0

qlikmsg4u
Specialist
Specialist

In script:

Load *,If(Left(CropCode,2)='CS',1,0) as CSCount;

Load * Inline [

CropCode

CS001

CS002

CS003

CS004

1001

1002];

in UI:

=Sum(If(Left(CropCode,2)='CS',1,0))

or

=Count({<CropCode={'CS*'}>}CropCode)

Mahamed_Qlik
Specialist
Specialist
Author

Not working.

sasiparupudi1
Master III
Master III

Untitled2.jpgIt shows 4 with the sample data.. how are you using it? may be can you share a sample?

qlikmsg4u
Specialist
Specialist

what do you mean by not working, it should work.what error you are getting

PFA

jagan
Partner - Champion III
Partner - Champion III

Hi,

This should work

=Count({<CropCode={'CS*'}>}CropCode)


If not try this


=Sum(Aggr(If(Upper(Left(CropCode, 2)) = 'CS', 1, 0), CropCode))


Hope this helps you.


Regards,

jagan.



Kushal_Chawda

create a flag in script,

if(wildmatch(lower(CropCode),'cs*',1,0) as CropCodeFlag

In front end use below expression

Count ({<CropCodeFlag={1}>}CropCode)

Mahamed_Qlik
Specialist
Specialist
Author

Yes it works now..

There was an issue with the source db.

Thank you for your help.