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

Display sales by customers who made free shipments

I have a task. I need to display only customers who have shipped for free, but I also need to see sales for these customers.Screenshot_1.jpg

The report should look like this:

Screenshot_2.jpg

Help solve this problem

7 Replies
Anil_Babu_Samineni

Please provide sample data

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kolov007
Contributor III
Contributor III
Author

I attached the document

antoniotiman
Master III
Master III

Hi Evgen,

Dimension : Client

Expressions :

Sum({<Client=P({<[Transaction Type]={'Free shipping'}>})>} Sales_USD)

Sum({<[Transaction Type]={'Free shipping'}>} quantity)

Regards,

Antonio

Anil_Babu_Samineni

Try this?

If(Column(1) <> '0', Sum(sales_usd))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kolov007
Contributor III
Contributor III
Author

Thank you

Kushal_Chawda

script Solution

Data:

LOAD Client,

           TransactionType,

           quantity,

           sales_usd

FROM Table:

left join(Data)

LOAD Client,

          sum(sales_usd) as sales_usd_Free

Resident Data

where TransactionType='Free Shipping'

group by Client;


Create chart


Dimension:

Client


Expression

1) Free Shipping


Sum({<TransactionType={'Free Shipping'}>}quantity)


2) Sales_usd

Sum(sales_usd_Free)

suhaskharat
Contributor III
Contributor III

For straight table ur Dim will be Client

1st Exp will be

=if(sum({<TrnType={Free}>}quantity)<>0,sum({<TrnType={Free}>}quantity))

2nd Exp..

=if(sum({<TrnType={Free}>}quantity)<>0,sum(sales_usd))