Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

selection of data and excluding one case

Hi

My data is looking like given below

report_id   product_id  priority

100           200             1

100           201             2

100           202             3

I am trying to get the count of report_id but my constraint is count(distinct If(priority=1 and priority<>2 and priority<>3,report_id))

and this should come as 1.

A report_id has so many product_id with different priority but i want to calculate only specific priority tickets irrespective of product_id.

Any ideas how to do this. Its really very urgent.

Tribhuwan

19 Replies
Gysbert_Wassenaar

count( {$<priority={'1'}, product_id= > } priority) will count the records where priority=1 while disregarding any selection of product_id


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for your reply.

User can select the Product Id from drop down and I have to write an expression which works in the manner I requested in my post

Thanks & Regards

Tribhuwan

Not applicable
Author

I am using If condition to achieve this as this is an existing application and I have already something like this

Count( Distinct If(condition1 and condition2 and condition3,…….,report_id))

Additionally I want to do this also from product ids.

Thanks in advance

Thanks & Regards

Tribhuwan

Not applicable
Author

Hi Gysbert

Kindly suggest any way to do this . It’s really very urgent.

Thanks & Regards

Tribhuwan

Not applicable
Author

Hi,

Why do you want to use only if condition & not set analysis ?

Regards

Not applicable
Author

HI

Actually I have already written expression which contains so many condition in “IF” and I want to add one more related to this product id.

I can’t switch to set analysis.

Thanks & Regards

Tribhuwan

Not applicable
Author

can u post ur complete expression here.....?

Regards

Not applicable
Author

I am comparing some field which are coming from different tables

Expression is like

Count( Distinct If(createdDate <= CalendarWeekEnd AND

Report_type = ‘Error’ AND

Priority_id = 1 AND

Blah Blah

)

My data contains report_id and every report_id is reported on one or more product_ids and every has different priority. So I wanted to calculate those report_ids irrespective of product id based on priority id.

As my existing expression is written in If so it would be very difficult for me to convert it into set analysis (8-9 comparisons related to dates in If that would be time consuming from development point of view)

Thanks & Regards

Tribhuwan

Not applicable
Author

Hi,

try:

if( createdDate <= CalendarWeekEnd AND

                                   Report_type = ‘Error’ AND

                                  Priority_id = 1 AND

                                 Blah Blah, count( distinct Report_id))