Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

qliksense help: to calculate items per order

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???

3 Replies
sunny_talwar

Would you be able to share some raw data and the output you expect to get out of it?

german24
Partner - Contributor III
Partner - Contributor III

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

karthiksrqv
Partner - Creator II
Partner - Creator II

Hi Souyma,

Please try this:

sum(aggr(if(count(DISTINCT itemno)=1,1,0),ORDER))

/

count(DISTINCT ORDER)