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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
sedalinda
Contributor
Contributor

pivot table get sales difference about weeks

Hello guys,

 

ı need help for qliksense enterprise edition platform.

ı have pivot table for sales persons, country, salesweeks data.

sales person and country is dimension and rows.

salesweeks is a column, measure is price in pivot table.

WEEK1 WEEK2 WEEK3 WEEK4 WEEK5 in below picture.

 

ı need to calculate WEEK1-WEEK2 price, WEEK2-WEEK3 price , calculate difference gap

how can I do this in frontend, please help me.

Thank you very much.

sedalinda_0-1674410568530.png

 

2 Replies
jcmachado
Contributor III
Contributor III

You can use the "Expression Editor" in QlikSense to create a new measure that calculates the difference between the prices of consecutive weeks. Here's an example of how you can do this:

  1. Go to the "Properties" pane of your pivot table and select the "Expressions" tab.

  2. Click on the "+" button to add a new expression.

  3. Name the expression "Week1-Week2" and enter the following formula: =SUM(IF([Week] = 'Week1', [Price], 0)) - SUM(IF([Week] = 'Week2', [Price], 0))

  4. Create another expression and name it "Week2-Week3" and enter the following formula: =SUM(IF([Week] = 'Week2', [Price], 0)) - SUM(IF([Week] = 'Week3', [Price], 0))

  5. You can also create another expression to calculate the difference gap between weeks by using the above expressions. =(Week1-Week2) - (Week2-Week3)

  6. Add the new expressions to the pivot table by dragging them from the "Expressions" tab to the "Columns" or "Rows" sections.

You should now have a pivot table that shows the difference in prices between consecutive weeks for each salesperson and country.

Please note that this is just an example, you might want to adjust the formula according to your data and needs.

sedalinda
Contributor
Contributor
Author

than you very much. In same time I user before script for do this.