Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis - Count(distinct not working

Hi,

Goal : To calculated Promotional Order % to Total Orders

Expression:

Total orders  = count(distinct(order_number))

Promotional Orders = count(DISTINCT(if(( promo_order_flag = 1),order_number,0)))

Dimension:

Year: year_no

(if I use:  if ( promo_order_flag=1, year_no)  Then I get correct count for Promotional orders, else I am getting unwanted blank rows

Month:

Day:

To calculate Promotional Order %

Now I changed expression of Total Orders = count( {$<promo_order_flag =, year_no=, day_no=, month_no=, redemption_type=>}distinct order_number)

But still I am getting same count.

If I remove promo_order_flag=1 from dimension (year_no): Then I get correct count, but getting unwanted rows

Please suggest where I am doing wrong! OR How to modify statements?

Many Thanks in Advance

- Deep

11 Replies
MK_QSL
MVP
MVP

=COUNT({1<promo_order_flag = {1}>}DISTINCT order_number)/COUNT({1} DISTINCT order_number)

Not applicable
Author

It is not working:

It is same as before:

1. Either Blank Lines

2. OR if I use it Suppressing other ordres using promotional order flag (it is as same as before)

Could you please upload the test file I added?

Many Thanks

- Deep