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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
didierodayo
Partner - Creator III
Partner - Creator III

Set Analysis error

Hello,

I can't get this set analysis expression to work. I have bar chart with following :

Dimension

Booking_ID

[BOOKING DATE]

expressions

1-

COUNT({<PAYMENT_TYPE_CD={'20'}>}DISTINCT([BOOKING DATE]))

2-

COUNT({<PAYMENT_TYPE_CD={'46'}>}DISTINCT([BOOKING DATE]))

it is working fine BUT Because of the high load we have decided to add WHERE the PAYMENT_TYPE_CD={'46'} ,SUM (BOOKING_INVOICE_AMOUNT>=1000 and RETURN only the booking_IDs that have a total payment_type_code>=1000.

I welcome your ideas.

Thanks

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Didier,

May be this?

1. COUNT(DISTINCT  {<PAYMENT_TYPE_CD={'20'},BOOKING_INVOICE_AMOUNT={"=Sum(BOOKING_INVOICE_AMOUNT)>=1000"}>} Booking_ID)

2. COUNT(DISTINCT  {<PAYMENT_TYPE_CD={'46'},BOOKING_INVOICE_AMOUNT={"=Sum(BOOKING_INVOICE_AMOUNT)>=1000"}>} Booking_ID)

View solution in original post

4 Replies
Not applicable

count(distinct(if(PAYMENT_TYPE_CD='46' and SUM (BOOKING_INVOICE_AMOUNT>=1000,Booking_ID)))

tamilarasu
Champion
Champion

Hi Didier,

May be this?

1. COUNT(DISTINCT  {<PAYMENT_TYPE_CD={'20'},BOOKING_INVOICE_AMOUNT={"=Sum(BOOKING_INVOICE_AMOUNT)>=1000"}>} Booking_ID)

2. COUNT(DISTINCT  {<PAYMENT_TYPE_CD={'46'},BOOKING_INVOICE_AMOUNT={"=Sum(BOOKING_INVOICE_AMOUNT)>=1000"}>} Booking_ID)

didierodayo
Partner - Creator III
Partner - Creator III
Author

Thanks Guys.

maksim_senin
Partner - Creator III
Partner - Creator III

Hi Didier,

From performance point of view it's better to calculate this in the load script.

Also please give a look at P() and E() set analysis functions.

Best regards,

Maxim