Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count columns where value=b

Hi,

this is the source table:

ProductCheckedPricePacked upCategorySent
Notebook YXZYes499NoHardwareNo

I create a table in the dashboard like this and want to count all "Yes" and all "No" for each product:

ProductYesNo
Notebook YXZ12

How can i do it?

regards,

Fritz

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Another Scripting Solution

LOAD *

,RangeSum(CheckFlag,PackFlag,SentFlag) as Yes's

,RangeMissingCount(CheckFlag,PackFlag,SentFlag) as No's

;

LOAD *

,if(Checked = 'Yes',1,null()) as CheckFlag

,if([Packed up] = 'Yes',1,null()) as PackFlag

,if(Sent = 'Yes',1,null()) as SentFlag

INLINE [

Product,Checked,Price,Packed up,Category,Sent

Notebook YXZ,Yes,499,No,Hardware,No

];

countflags.JPG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

3 Replies
sunny_talwar

May be these

Dimension

Product

Expression

=SubStringCount(Upper(Checked&' '&Price&' '&[Packed up]&' '&Category&' '&Sent), 'YES')

=SubStringCount(Upper(Checked&' '&Price&' '&[Packed up]&' '&Category&' '&Sent), 'NO')


Capture.PNG

stabben23
Partner - Master
Partner - Master

maybe like this:

in script create flags for each, Checked, Packed up, Sent like;

if (Checked='Yes',1) as Checked_Yesflag,

if(Packed up='Yes',1) as PackedUp_Yesflag,

if(Sent='Yes',1) as Sent_Yesflag,

if (Checked='No',1) as Checked_Noflag,

if(Packed up='No',1) as PackedUp_Noflag,

if(Sent='No',1) as Sent_Noflag

and in Dashboard object expression for YES =sum(Checked_Yesflag+PackedUp_Yesflag+Sent_Yesflag)

and for No =sum(Checked_Noflag+PackedUp_Nosflag+Sent_Nosflag)

vinieme12
Champion III
Champion III

Another Scripting Solution

LOAD *

,RangeSum(CheckFlag,PackFlag,SentFlag) as Yes's

,RangeMissingCount(CheckFlag,PackFlag,SentFlag) as No's

;

LOAD *

,if(Checked = 'Yes',1,null()) as CheckFlag

,if([Packed up] = 'Yes',1,null()) as PackFlag

,if(Sent = 'Yes',1,null()) as SentFlag

INLINE [

Product,Checked,Price,Packed up,Category,Sent

Notebook YXZ,Yes,499,No,Hardware,No

];

countflags.JPG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.