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

Pivot with expression column

I would like to have a pivot with a column with a certain expression.

Here's my data:

Load * Inline [
Nr., Category, Amount, Period
1, Sales, 10000, 202001
2, Cost of Sales, 7500, 202001
3, Gross Margin, 2500, 202001
1, Sales, 15000, 202002
2, Cost of Sales, 7500, 202002
3, Gross Margin, 7500, 202002
]

I would like to have the amount of sales on every row, per period.

The result of the expression 'Sum(Total{<Nr.={1}>}Amount)' as measure is:

mvs01_0-1608028039480.png

So I'm getting the total sales on every row, but not per period.

I would like to have the amount of sales on every row, per period. In this case, for column period 202001: 10000 and for column period 202002: 15000.

Is this possible and how can I achieve his?

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Try this:

sum({$<[Nr.]={1}>} Total <Period> Amount)

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

Try this:

sum({$<[Nr.]={1}>} Total <Period> Amount)

mvs01
Contributor II
Contributor II
Author

Thanks @GaryGiles

This is working!