Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

canmarroig
Contributor

How to create ranges

Hi, i've an excel table like this:

 

customerprod aprod bprod cprod d
a100320
b1200000
c2008003001000
d502340051
e2325500
f11445611

i need to create in my frontend some ranges: how many customers have

  • 0-500
  • 501-1000
  • 1001-2000

for each product. My output should be:

rangeproduct aproduct bproduct cproduct d
0-5006465
501-10000101
1001-2000 0100

Can you help me?

Tks

1 Solution

Accepted Solutions

Re: How to create ranges

Data:

CrossTable(Product, Value)

Load * Inline

[

  customer, prod a, prod b, prod c, prod d

  a, 100, 3, 2, 0

  b, 1, 2000, 0, 0

  c, 200, 800, 300, 1000

  d, 50, 23, 400, 51

  e, 23, 25, 50, 0

  f, 11, 44, 56, 11

];

Left Join (Data)

Load

  customer,

  Product,

  If(Value >= 0 and Value <= 500, '0-500',

  If(Value > 500 and Value <= 1000, '501-1000',

  If(Value > 1000 and Value <= 2000, '1001-2000'))) as ValueFlag

Resident Data;

Now Create a Pivot Table

Dimensions

ValueFlag

Product

Expression

COUNT(ValueFlag)

2 Replies

Re: How to create ranges

Data:

CrossTable(Product, Value)

Load * Inline

[

  customer, prod a, prod b, prod c, prod d

  a, 100, 3, 2, 0

  b, 1, 2000, 0, 0

  c, 200, 800, 300, 1000

  d, 50, 23, 400, 51

  e, 23, 25, 50, 0

  f, 11, 44, 56, 11

];

Left Join (Data)

Load

  customer,

  Product,

  If(Value >= 0 and Value <= 500, '0-500',

  If(Value > 500 and Value <= 1000, '501-1000',

  If(Value > 1000 and Value <= 2000, '1001-2000'))) as ValueFlag

Resident Data;

Now Create a Pivot Table

Dimensions

ValueFlag

Product

Expression

COUNT(ValueFlag)

canmarroig
Contributor

Re: How to create ranges

Yess, tks!

Community Browser