Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cscherer
Contributor
Contributor

group by or cluster?

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

11 Replies
Not applicable

you can use 10000 but i would create a function that you call from load script

in macro   (Tools-> Edit module)

function checkdays(qty)

if qty<=5 then

                    checkdays="days with 1 to 5 orders"

elseif qty<=10 then

                    checkdays= "days with 6 to 10 orders"

elseif qty<=20 then

                    checkdays= "days with 11 to 20 orders"

else

          checkdays ="days with >20 orders"

end if

end function

then change load script

Orders:

LOAD order,

     date,

     article

FROM

C:\test.xls

(biff, embedded labels, table is Sheet1$);

Summary:

Left Join(Orders)

Load date,

          checkdays(count(distinct order)) as DayType

resident Orders group by date;

cscherer
Contributor
Contributor
Author

this works, too. thanks a lot!