Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change expression in straight table?


Hi,

I have data in excel as below

Date                          ID               outcome             share           process

23/03/2014              4242              Failed                Fail              Fail

I created a straight table to show no of fail wit the below expression

count({<Result={'Failed'}>}Distinct ID)

but in the table it is not showing the ID why because in excel there are two instances as Failed and Fail. Can anyone suggest me please how to change the above expression to include both Failed and Fail. I tried like below but it is not working

count({<Result={'Failed','Fail'}>}Distinct ID)

Thanks.

9 Replies
senpradip007
Specialist III
Specialist III

Where is your Result field as you have explained inyour original post?

swuehl
MVP
MVP

This should work if 'Result' is your field and not 'outcome'.

You can also try a search in your set expression:

count({<Result={"Fail*"}>}Distinct ID)

Gysbert_Wassenaar

I don't see a field called Result. Perhaps you mean outcome instead: count({<outcome={'Fail*'}>}Distinct ID)


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks. The Result is from cross table. actually I used a cross table

TblData:

CrossTable(Test,Result,3)

LOAD

Date                                                 

     ID ,                                                           

     Outcome,

     [share],

     [Process]

   

FROM

[Report.xlsx]

(ooxml, embedded labels, table is Sheet);

Not applicable
Author

Thanks. tried with outcome but it is showing incorrect values. Do I need to change anything?

senpradip007
Specialist III
Specialist III

Can you upload sample qvw along with xlsx file?

Not applicable
Author

Since you made a cross table, your "Test" column I think will contain "Share" and "Process", and then Result will contain "Fail" or "Failed". So maybe try:


count({<Test = {'Share'}, Result={'Fail*'}>}Distinct ID)


or


count({<Test = {'Process'}, Result={'Fail*'}>}Distinct ID)

sarvjeet
Contributor III
Contributor III

I recommend handle this in scripts. Create a bit flag "flg_failed" with value '0' and '1'  using apply-map .

1 for failed or fail

0 for anything else

Expression in Chart should be :  sum(flg_failed)

Aggregation is faster then Count or set-analysis

-Sarvjeet

Anonymous
Not applicable
Author

Below expression should work,

Count ({<Result={"*Fail*"}>} DISTINCT ID)


You can even align "Fail", "Failed" etc to unique data "Fail" in backend script and use below expression.


Count ({<Result={"Fail"}>} DISTINCT ID)