Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to use Group by Clause
i want to show Customer Count In Bucket Analysis.
My sales Buckets are
<10K
>10K to <=30K and so on
i want to show count of customer who had done sales accordingle,
e.g. if 4 customer did Total sales less than 10K in a month than they should come in Bucket of <10K.
Kindly help.
You can create bucket by hard coding at script editor
on script editor type
load *,
if(sum(sales)<10,000,'<10k',if(sum(sales)>10000 and sum(sales)<=30000,'>10k to <=30k',>30k)) as bucket,
resident yourtablename;
and create a bar chart and in the dimension add bucket to the dimension field and in the expression tab type following expression
count(Customer)
regards
bhawna
you need a group by clause. If this is the way you want to go, then
if(sum(sales)<10,000,'<10k',if(sum(sales)>10000 and sum(sales)<=30000,'>10k to <=30k',>30k)) as bucket,
resident yourtablename
Group by Customer;
hi Abhay,
U can make use of Class function : Class() to get the result u nid
Regardz,
Vaibz...
Use class() (if the classes are qui-distant, else IF)to create the classes in calculated dimension or a new field in the script, then in expression simple count() should work.
@ script level sum function is giving me error
Because you need group by.
Sum is an aggregate function so it needs a group by statement.
Add Group by Customer
after your FROM clause.