Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I've got a problem with clustering data. I've got dates and orders and I want to know in the first steps, how many orders I've got per day - this works. In the second step, I want to know how many days I've got with 1-5 orders, 6-10 orders and so on.
It shall look like this:
I attached the .qvw
Thanks in advance,
Clemens
ok try this:
Load Script:
Orders:
LOAD order,
date,
article
FROM
C:\test.xls
(biff, embedded labels, table is Sheet1$);
Summary:
Left Join(Orders)
Load date,
if(count(distinct order)<=5,
'days with 1 to 5 orders',
if(count(distinct order)<=10,
'days with 6 to 10 orders',
if(count(distinct order)<=20,
'days with 11 to 20 orders',
'days with >20 orders'))) as DayType
resident Orders group by date;
Table:
DayType as dimension
count(distinct date) as Expression
here is the picture:
try
if(count(distinct order)<=5,'5',if(count(distinct order)<=10,'10','Other')) as dimension
thank you, but that is not what I mean. I need the "next step"
15 times <= 5
11 times <=10
...
if(count(distinct order)<=5,'5',if(count(distinct order)<=10,'10',if(count(distinct order)<=20,'20','>20')))) as dimension
or:
if(count(distinct order)<=5,'Days with 1 to 5 orders',if(count(distinct order)<=10,'Days with 6 to 10 orders ',if(count(distinct order)<=20,'Days with 11 to 20 orders','days with >20 orders')))) as dimension
it doesn't work. have you got the .qvw?
ok try this:
Load Script:
Orders:
LOAD order,
date,
article
FROM
C:\test.xls
(biff, embedded labels, table is Sheet1$);
Summary:
Left Join(Orders)
Load date,
if(count(distinct order)<=5,
'days with 1 to 5 orders',
if(count(distinct order)<=10,
'days with 6 to 10 orders',
if(count(distinct order)<=20,
'days with 11 to 20 orders',
'days with >20 orders'))) as DayType
resident Orders group by date;
Table:
DayType as dimension
count(distinct date) as Expression
that`s it! thank you so much!
Hello,
one more question: is it possible to intricate more than 7 if-formulas? If not, I think I`ll need another solution for my problem...
Thanks,
regards,
cs