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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview Expression problem...help needed

Hello All,

I am using an expression as below

This expression is working fine. However, with this expression, All those meterial codes are being ignored which have False item responses.

I want the count to be shown as above, but for those meterial codes, which have item response=False, I want to show 0 so that the rest of the meterial codes are also shown.

currently only those meterial codes are being shown which have Item response=True. The rest are not being shown because of the above expression. I want the rest of them to be shown with 0

br

Arif

count(if([Item Response]='True',[Material Code])) /count([Material Code])

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Please, take a look into attached example.

Kind regards,

Janusz

View solution in original post

13 Replies
Not applicable
Author

Hi,

Try this:

count(if([Item Response]='True',[Material Code],0)) /count([Material Code])

and uncheck the "Suppress Zero-Values" option on the Presentation Tab.

Hope, it will help.

Regards,

Janusz

christian77
Partner - Specialist
Partner - Specialist

I don`t finish to understand your question.

By now, you can change your expression for this one. It´ll be faster.


count({$<[Item Response]={'True'}>} distinct [Material Code]) / count(distinct [Material Code])

or

count({$<[Item Response]={'True'}>} distinct [Material Code]) / count({$<[Item Response]={'True','False'}>} distinct [Material Code])

Not applicable
Author

Hello,

Thanks for your reply. However, this method has a flaw. This is a count, and if we use the expression count(if([Item Response]='True',[Material Code],0)), then it will take the count of 0 for false values, and so the count will always be 100%

I do not want the individual meterial code to be 0, since the count will always be more. I want the count to be shown as zero

Let me know if you did not get my point

br

Arif

Not applicable
Author

Hello Chritian 77,

Thanks for youre reply. I do not want the distinct count. so thats why i did not put the distinct key word

count(if([Item Response]='True',[Material Code])) /count([Material Code])


The  Problem with this expression is that it shows only those Meterial codes, which have Item Response= True

What i want is the All the rest of meterial codes, which have Item Response=False should also be shown in the table, with the Count being 0, since there Item Response was False.

This way, I want to be able to see that these the meterial codes, which have Item Response=True and those which count is 0 are the ones that have false Item Response

The above expression is infact showing the percentage

So simply ... I want those Meterial Codes, where Item Response = False ....to be shown in the chart, with the above percentage equal to 0

br

Arif

Not applicable
Author

ArifShah,

Have you unchecked the "Suppress Zero-Values" option?

Kind regards,

Janusz

Not applicable
Author

yes, I have unchecked but that has no use since the count for False items is always more than 0. The if condition is inside the count ....soo like 

count(if([Item Response]='True',[Material Code],0))


so in the above expression, If there are more than one Meterial Codes that have False response, then the count is always going to be more than 0, which is not right. For the false item response, I want the count to be 0

br

Arif

Not applicable
Author

Arif,

My expression is wrong.

Please, use Christian's solution, plus uncheck the "Suppress Zero-Values".

Kind regards,

Janusz

Not applicable
Author

Hello Christian77,

can you please explain how can the below expression yeild 0 count for false item responses?

I don't understand set analysy very well

count({$<[Item Response]={'True'}>} distinct [Material Code]) / count(distinct [Material Code])

or

count({$<[Item Response]={'True'}>} distinct [Material Code]) / count({$<[Item Response]={'True','False'}>} distinct [Material Code])


br

Arif

Not applicable
Author

Hello,

I have tried Chritian77 expression too, but it is not working

Arif