Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Displaying dimension values in a chart when there are no records for the expression to calculate

I have two customers, one of which has some purchase and sales transactions and one which doesn't.

I would like to create a chart which sums the purchase and sales totals for each client AND displays both clients, even though one will not have any transactions to sum.

Many thanks in advance for any suggestions

15 Replies
Not applicable
Author

Manish,

Thanks for the script - it does indeed work will requires me to alter the source data in the load.

Currently I have one field for quantity and a description field to denote purchases and sales.

load * inline [

CLIENT_NAME,TransactionTypeCode, Quantity, Price, Amount

Company A, P, 10000, 5.00, 50000.00

Company A, S, 10000, 2.00, 20000.00

];

My current chart uses set analysis to sum the totals - (Sum({$<TransactionTypeCode={'P'}>}Quantity))

Do you know if there is a way to get the result you have offered using the data in its current form or am I best to change the load script?

Thanks again

john

MK_QSL
MVP
MVP

Let me have at least 4-5 rows of your data and also what you want to achieve.

At this stage I am unclear...

Not applicable
Author

clients:

LOAD * INLINE [

CLIENT_NAME

Company A

Company B

Company C   

     ];

    

transactions:

load * inline [

CLIENT_NAME,TransactionTypeCode,Quantity,Price, Amount

Company A,P,10000,5.00, 50000.00

Company A,S,10000,2.00, 20000.00

Company C,S,20000,2.00, 40000.00

Company C,S,5000,2.00, 10000.00

Company C,S,10000,2.00, 20000.00

];

What I'm hoping to see in my chart is a record displayed for each company, something like this:

CLIENT_NAMEPurchasesSalesPurchase total valueSales total value
Company A10000100005000020000
Company B0000
Company C035000070000
MK_QSL
MVP
MVP

Create a Straight Table

Dimension = CLIENT_NAME

Tick Suppress When Value is NULL

Tick Show All Values

Expressions

Purchase : SUM({<TransactionTypeCode = {'P'}>}Quantity)

Sales : SUM({<TransactionTypeCode = {'S'}>}Quantity)

Purchase Total Value : SUM({<TransactionTypeCode = {'P'}>}Amount)

Sales Total Value : SUM({<TransactionTypeCode = {'S'}>}Amount)

SAMPLE.JPG.jpg

ThornOfCrowns
Specialist II
Specialist II

I agree that this is the method to follow, I was just in the process of typing a similar reply.

Not applicable
Author

Great - thanks very much - I'll play around with the dimension checkboxes you've highlighted and it should show me what I want.