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: 
Anonymous
Not applicable

Dynamic bucket

Hi,

I need to create a bucket for my invoice spend ranging from £0.25m - £5m, £0.5m-£1m and so on. But this bucket should be dynamic on my selection of the currency which are USD($) and GBP(£). Is it feasible to create this on UI level opr should i create it on Data Model level?

Please suggest which one and how?

Thanks.

4 Replies
karthikoffi27se
Creator III
Creator III

Hi Abhishek,

Please use the class function for your ranging value.

You can use the class either in script or in UI.

Many Thanks

Karthik

suryaa30
Creator II
Creator II

Do you have separate fields for different currencies values?? like InvoiceUSD ,InvoiceGBP

also should the bucket size be dynamic??

Refer my previous post for sample dynamic bucket using class function

Bucketing in bar Chart-Class function

Anonymous
Not applicable
Author

HI Surya,

I don't have different fields. I just have InvoiceGBP which gets converted in USD according to a currency conversion rate coming from a different source.

The bucket size is not dynamic.

effinty2112
Master
Master

Hi Abhishek,

You could use the class function as suggested by Karthik but this would restrict your buckets to a fixed size. You could try something like:

Pick(Match(Currency,'GBP','USD',

Pick(Match(-1,

Spend < =250000,

Spend < =500000,

Spend < =1000000,

-1),

'£0-£0.25m',

'£0.25-£0.5m',

'£0.5-£1m',

'>£1m'),


Pick(Match(-1,

Spend *ConversionRate< =250000,

Spend*ConversionRate < =500000,

Spend*ConversionRate < =1000000,

-1),

'$0-$0.25m',

'$0.25-$0.5m',

'$0.5-$1m',

'>$1m'))


Cheers


Andrew