Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
anwar_qlik
Contributor III
Contributor III

Compare Min/Max for Bucket

Hi

We have requirement for comparing a aggregated value on front end compare it with Min and Max and find the bucket(this bucket would be the Dimension for a chart)

Bucket Table would be

Row Num

Min

Max

Bucket

1

0

5

0-5

2

6

10

6-10

3

11

20

11-20

And Value aggregated on front end would be compared with min and max and Bucket should be selected e.g. value is 3 than 0-5 bucket would be selected.

This Bucket would be used as dimension in a chart.

Please advise how this can be implemented.

Regards,

ASP

21 Replies
Anil_Babu_Samineni

May be MaxString(Bucket)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
tresesco
MVP
MVP

Could you share a sample data?

vinieme12
Champion II
Champion II

anwar_qlik
Contributor III
Contributor III
Author

Row Num

Provider ID

Patient ID

1

AA

11

2

AA

12

3

AA

13

4

BB

21

So I want to Count Patient per Provider e.g aggr(count(Patient),Provider) from above AA has 3 Patients.

Referring to Bucket table I should get “0-5” as 3>0(Min Value) and 3<5(Max Value),This will be Dimension

Now Expression would be how many Provider in each bucket. So “0-5” bucket has 1 Provider

I can write if Statement with hardcode values but client wants it dynamic, with just values in table changed buckets should change.

tresesco
MVP
MVP

How do you get min/max values?

passionate
Specialist
Specialist

Hi Anwar,

The best practice to achieve this is at load script.

You can use interval match to this in load script.

Is there any specific reason you want to do this on front end?

Regards,

Pankaj

passionate
Specialist
Specialist

Hi Anwar,

This will help you:

Sample:

Left join Table

Load Count([Patient ID]) as CountPatientId,[Provider ID]

Resident Table //Table is name of table in which patientid and provider id is present

Group by [Provider ID]

//This will give one more column in Table which is count of PatientID that you are looking.

Left join (Sample)

intervalmatch(CountPatientId)

Load

Min,

Max

Resident;

Left join

Load * Resident

Table1; //Table is name of table in which min and max interval is present

Regards,

Pankaj

antoniotiman
Master III
Master III

Hi Anwar,

maybe

Calculated Dimension :

=Aggr(Class(Count(DISTINCT [Patient ID]),5,'Nr. Patients'),[Provider ID])

Regards,

Antonio

anwar_qlik
Contributor III
Contributor III
Author

Min and Max is in the Bucket Table(Please see my original post)