Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

deepaksingh
New Contributor III

Range Bucket

I need to Count Distinct CUST_CD&DIST_CD where DISC_TYPE = F and MTD_VOL<40&>0. Can anyone suggest how to set range in set ananlysis.

15 Replies
DavidŠtorek
Contributor III

Re: Range Bucket

Hi,

if I understand wel,than following should help you

Count({$<MTD_VOL={">0<40"},DISC_TYPE={'F'}>}CUST_CD)+ Count({$<MTD_VOL={">0<40"},DISC_TYPE={'F'}>}DIST_CD)

Re: Range Bucket

or this

Count({$<MTD_VOL = {">0<40"}, DISC_TYPE = {'F'}>}DISTINCT CUST_CD&DIST_CD)

deepaksingh
New Contributor III

Re: Range Bucket

MTD_Vol is not a field, i am calculating it using expression, so that expression how i can use in set analysis for particular range.

deepaksingh
New Contributor III

Re: Range Bucket

MTD_Vol is not a field, i am calculating it using expression, so that expression how i can use in set analysis for particular range.

DavidŠtorek
Contributor III

Re: Range Bucket

And is it problem for you to calculate it in a script? Than you could use our suggestions above.

Otherwise you will have to use an IF statement. Something like

If(MTD_VOL expression >0 and MTD_VOL expression<40,Count({$<DISC_TYPE={'F'}>}CUST_CD)+ Count({$<DISC_TYPE={'F'}>}DIST_CD) ))

arvind1494
Valued Contributor

Re: Range Bucket

Try following expression :


Count({<DISC_TYPE = {'F'},MTD_VOL={">0<40"}>}Distinct CUST_CD)

+

Count({<DISC_TYPE = {'F'},MTD_VOL={">0<40"}>}Distinct DIST_CD )

Re: Range Bucket

Would you be able to share a sample to show what you have and what you are looking to get?

deepaksingh
New Contributor III

Re: Range Bucket

I am calculating volume from table Invoice_details and Production_hierarchy using fields TTL and UOM

i.e volume = (TTL / UOM)

and logic in which i have to use MTD_Volume is

(0<X<10):

Count of Distinct CUST_CD&DIST_CD in CUSTOMER where VISI/NVISI = VISI in CUSTOMER and MTD_VOL<10&>0.

simran04
New Contributor II

Re: Range Bucket

Hi Deepak,

Try the following statement.

Count( {<DISC_TYPE = {'F'},  MTD_VOL={">0 <40"}>}  distinct CUST_CD)

+

Count( {<DISC_TYPE = {'F'},  MTD_VOL={">0 <40"}>}  distinct DIST_CD)

Community Browser