Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
chinnu123
Creator
Creator

percentages

Hi Qlik,

I am facing issue in calculating the %ages by selecting only few of the selections from the selection criteria.

from the data provided in the attachment

whenever "survey" is selected from an listbox,

The data should be shown based on few conditions and the conditions are:-

1. Survey- Shop

     L1-> retail

     L2-> sales and order

     Stage1-> Approved

     Stage2-> Active

correspondingly ABC, BBC and DDC percentages should be calculated

%age formula:- (count of Y/ count(Y + N))*100

Blanks should be ignored.

2. Survey- Travels

     L1-> Transport

     L2-> Cars and Buses

     Stage1-> Approved and Pending

     Stage2-> Active

     Type-> exclude System Error

correspondingly ABC, BBC and DDC percentages should be calculated

%age formula:- (count of Y/ count(Y + N))*100

3. Survey-> Africa

     L1-> Bdm Solutions

     L2-> Ethics, Special Care, Analyis

     Stage1-> Approved

     Stage2-> Active

   Type- Exclude System error

correspondingly ABC, BBC and DDC percentages should be calculated

%age formula:- (count of Y/ count(Y + N))*100.

5 Replies
Not applicable

Do you need apply the filter on UI or loading the data from file ? what about other field values in the survey?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expressions below

1. Survey- Shop

ABC%:

(Count({<L1={'Retail'}, L2={'Sales', 'Order'}, Stage1={'Approved'}, Stage2={'Active'}, ABC={'Y'}>} ABC)/

Count({<L1={'Retail'}, L2={'Sales', 'Order'}, Stage1={'Approved'}, Stage2={'Active'}, ABC={'Y', 'N'}>} ABC)) * 100


BBC%:

(Count({<L1={'Retail'}, L2={'Sales', 'Order'}, Stage1={'Approved'}, Stage2={'Active'}, BBC={'Y'}>} BBC)/

Count({<L1={'Retail'}, L2={'Sales', 'Order'}, Stage1={'Approved'}, Stage2={'Active'}, BBC={'Y', 'N'}>} BBC)) * 100


DDC%:

(Count({<L1={'Retail'}, L2={'Sales', 'Order'}, Stage1={'Approved'}, Stage2={'Active'}, DDC={'Y'}>} DDC)/

Count({<L1={'Retail'}, L2={'Sales', 'Order'}, Stage1={'Approved'}, Stage2={'Active'}, DDC={'Y', 'N'}>} DDC)) * 100


Likewise create the expressions for the remaining scenarios 2. Survey- Travels & 3. Survey-> Africa


Hope this helps you.


Regards,

jagan.



chinnu123
Creator
Creator
Author

Hi Jagan, Thanks for your response.

The above expressions are not working. We are getting Nulls when we tried to implement in Straight table

chinnu123
Creator
Creator
Author

Hi Dathu,

yes it should be apply on the UI. The other field values are having the similar  condition as of 2 and 3 Which are mentioned in My post.

Thanks & regards,

chinnu

jagan
Luminary Alumni
Luminary Alumni

Hi,

It is working for me, please check attached file.

Regards,

jagan.