Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
canmarroig
Partner - Creator
Partner - Creator

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
MK_QSL
MVP
MVP

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)

View solution in original post

2 Replies
MK_QSL
MVP
MVP

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
Partner - Creator
Partner - Creator
Author

Yess, tks!