Link to home
Create AccountLog in
Databases

Databases

--

Questions

--

Followers

Top Experts

Avatar of LION KING
LION KING🇺🇸

Difference between two values in pivot table
Qlikview Help!!!
I have a pivot table in Qlikview 11.
1) Original - is my original pivot table
2) Final - is the pivoted version of Original
3) Result - this is what the result needs to be

How to calculate the difference columns - DIFF1, DIFF2, DIFF3 in the same format as attached? Please help.

User generated image

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Pawan KumarPawan Kumar🇮🇳

Are you using a query for pivot table ? Which Database are you using ?

Avatar of LION KINGLION KING🇺🇸

ASKER

Yes, Pawan. I'm using a query (load script) in Qlikview. SQL Server 2016 is the database.

Avatar of Pawan KumarPawan Kumar🇮🇳

Please provide me the query. Will modify that for you to the required result. Also add SQL Server as a Topic for future reads.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of LION KINGLION KING🇺🇸

ASKER

ODBC CONNECT TO TEST_SQL_SERVER;
CUR_QTR:
LOAD
      NAME,
      DATE1,
      COMPANY,
      AMT,
      LEFT(DATE1,4)             AS YR,
         RIGHT(DATE1,2)             AS MTH
;
SELECT *
FROM CUR_QTR;

JOIN(CUR_QTR)
LOAD
NAME,
      DATE1,
      COMPANY,
      AMT,
      LEFT(DATE1,4)             AS YR,
         RIGHT(DATE1,2)             AS MTH


FROM
[C:\TEST.xlsx]
(ooxml, embedded labels, table is Sheet1);

This is the query from Qlikview. CUR_QTR is the table from SQL server that has data for 201703 only. For prior period the data is loaded from Excel file. While creating the pivot table in QLikview, this script is used to create dimensions n measures. Measure is the sum(Amt).

Avatar of Pawan KumarPawan Kumar🇮🇳

Are you doing pivot in SQL server or in QlikView?

Avatar of LION KINGLION KING🇺🇸

ASKER

Doing Pivot in Qlikview - within Pivot table (chart).

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Pawan KumarPawan Kumar🇮🇳

try Like this... (Never did that in UI though)

DIFF1 : {201703} - {201612}

Avatar of LION KINGLION KING🇺🇸

ASKER

I tried that earlier. That didn't work. It also creates column under each year month.

ASKER CERTIFIED SOLUTION
Avatar of Pawan KumarPawan Kumar🇮🇳

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of Pawan KumarPawan Kumar🇮🇳

Question abandoned.
Provided tested solution.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Databases

Databases

--

Questions

--

Followers

Top Experts

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.