Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rikkeqlik
New Contributor II

Price group/interval match

I would like to use the following code, but with the sum of the field assosiated with IntervalMatch. Is that possible?

// PriceGroup:

// LOAD * Inline [

// Start,Stop,PriceGroup

// 0,    99.99,    0-100

// 100,    499.99,    100-500

// 500,    999.99,    500-1000

// 1000,    ,    Over 1000

// ];

// Join(PriceGroup)

// IntervalMatch(CataloguePrice)

// Load

//     Start,

//     Stop

// Resident PriceGroup;

// Drop Fields Start, Stop;

4 Replies

Re: Price group/interval match

Sum of fields? can you elaborate with an example?

rikkeqlik
New Contributor II

Re: Price group/interval match

I would like to create two groups; revenue>500' and revenue<500'. The purpose is to count entities with revenue>500' pr. quarter.

// RevenueGroup:

// LOAD * Inline [

// Start,Stop,PriceGroup

// 0,    499000,    less than 500'

// 500000,    ,   more than 500'

// ];

// Join(RevenueGroup)

// IntervalMatch(Revenue) <----------------- This is where I need Sum(Revenue) or else the results are showing only single lines over 500'

// Load

//     Start,

//     Stop

// Resident PriceGroup;

// Drop Fields Start, Stop;

rikkeqlik
New Contributor II

Re: Price group/interval match

Forgot to change "PriceGroup", should be "RevenueGroup"

Re: Price group/interval match

Why don't you create a new field before you do interval match?

Fact:

LOAD Entity,

     Quarter,

     ....,

     Revenue

FROM ...;

Left Join (Fact)

LOAD Entity,

     Quarter,

     Sum(Revenue) as TotalRevenue

Resident Fact

Group By Field1, Field2;

and now do interval match using Total Revenue....

Community Browser