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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
betz
Contributor II
Contributor II

Pivot Table Month by Month

Hello,

How do I achieve the following layout?

I want to sum and count the sales per month.

For example the data looks like this:

LOAD

Product,

SalesDate,

Amount,

Quantity

 

As in the following image, I assume it should be a PIVOT table so I need the SalesDate to be a dimension, but how do I make each month a dimension like in the image?

betz_0-1710673654003.png

 

Labels (1)
5 Replies
Or
MVP
MVP

You would add a Month field to your load, e.g.

LOAD

Product,

SalesDate,

MonthName(SalesDate) as SalesMonth,

Amount,

Quantity

betz
Contributor II
Contributor II
Author

Yes, but would it show the dimensions as I described like in the image I've provided?

Nagaraju_KCS
Specialist III
Specialist III

Try this

LOAD Category,
Description,
Month(Date)&'-'&Year(Date) as MonthYear,
Qty,
Amount
FROM tableName;

qv_testing_0-1710689722801.png

 

 

barnabyd
Partner - Creator III
Partner - Creator III

G'day @betz,

The solution from @Nagaraju_KCS, while it will give you the correct output, it will sort alphabetically, which you don't want.

The solution from @Or, which uses the MonthName() function, gives you the correct date format and the correct sorting.

To achieve the dimensions as in your diagram, you need to use the Pivot chart, so that you can add your dimensions to both rows and columns.

Cheers, Barnaby.

Barnaby Dunn
BI Consultant
Nagaraju_KCS
Specialist III
Specialist III

create one field for sort like below

Year(Date)*100+(Num(Month(Date))) as Sort,

and apply on chat sort expression.

qv_testing_0-1710732302978.png