Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am developing a dashboard in qliksense and stuck at 1 point and require help.
so i need to count no of items per order and if there is only 1 item then calculate % of such orders.
i wrote the formula as :
if((if(not isnull(week) ,count(distinct(item)))
/
if(not isnull(week), count(ORDER)))=1,count(ORDER))
/
if(not isnull(week) ,count(distinct(ORDER)))
when i convert it to % the value i get is above 100%, so basically it is calculating all the items/ all the orders.
what i need is: create another table where you count the number of items per order
then on this table you count the number of orders with only one item
how to do this???
Would you be able to share some raw data and the output you expect to get out of it?
Hi,
try this...
//Script...
TempOrders:
LOAD
Num_Orders,
Count(DISTINCT item) as Cant_item
Resident Orders
Where NOT IsNull(week)
Group By Num_Orders;
//mMtrics in graphics...
=Count({< Cant_item={1} >} Num_Orders) / Count(Num_Orders)
Best regards,
German
Hi Souyma,
Please try this:
sum(aggr(if(count(DISTINCT itemno)=1,1,0),ORDER))
/
count(DISTINCT ORDER)