Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

How to use a table fields twice in a pivot Table

Hi Qlikview community,

I am new to Qlikview and I have 2 questions:

1. I have Table, Transfer that contains the quantity transferred between factories.

The source factory has a CODUSN and the Destination factory has code CODUSNSRC_DST. These two field are in the same table in addirion to the quantity transferred.

The code Qlikview I wrote, but I'am not sure if it is correct:

Directory;
USINE:
LOAD CODUSN,
CODREG,
SIGUSN
FROM
[..\QVD\USINE.qvd]
(
qvd);

Directory;
USN_SRCDST:
LOAD //CODUSN,
CODUSN AS CODUSNSRC_DST,
// CODREG,
CODREG AS CODREGTRANSF,
//SIGUSN,
SIGUSN AS LIB_USNSRCDST
FROM
[..\QVD\USINE.qvd]
(
qvd);

My question is, is this coorect?

2. I want to display the quantity transferred between the regions using a third table named REGION as follow:

Directory;
REGION:
LOAD CODREG,
SIGREG AS SIGREGTRANSF
FROM
[..\QVD\REGION.qvd]
(
qvd);

But the result is not correct. It shows me only the transfers Inside each region and not between the regions.

Attached the result of the pivot table.

Thank you very much in advance,

Kind regards,

Abdallah

1 Solution

Accepted Solutions
Highlighted
Creator
Creator

Re: How to use a table fields twice in a pivot Table

i am not sure to get it but ...

as far as I understand

You need two region tables

source region and target region

View solution in original post

8 Replies
Highlighted
Champion
Champion

Re: How to use a table fields twice in a pivot Table

Hi,

what is your table structure ?

to be able to see the Quantity movement between regions, you must have something like this (as data strcuture):

Quantity     |    the region from which comes the quantity     |     the region to which the quantity is going

Highlighted
Creator III
Creator III

Re: How to use a table fields twice in a pivot Table

Hi Youssef,

The Table containing the quantity doesn't has source/destination régions but only source/destination factories (CODUSN and CODUSNSRC_DST). The factory code is connected to the region in the Table REGION.

- So I have factory Table connected at the same time to the region table and to the table containing the quantity of the transfert.

- I am trying to display the transfers between region in pivot Table (one dimention region source and the other one destination region.

Thank you,

Abdallah

Highlighted
Creator
Creator

Re: How to use a table fields twice in a pivot Table

i am not sure to get it but ...

as far as I understand

You need two region tables

source region and target region

View solution in original post

Highlighted
Partner
Partner

Re: How to use a table fields twice in a pivot Table

Hi,

Can you please explain more clearly and also share your expected output...

Highlighted
Champion
Champion

Re: How to use a table fields twice in a pivot Table

No problem, if your table have the source/destination factories and the factories are connected to the regions, just put the source region and destination region as dimensions and the Quantity as a Measure.

try to attach sample data or sample app to take a look at the data structure

Highlighted
Creator
Creator

Re: How to use a table fields twice in a pivot Table

is it okay to share your sample data and qvw?

if it is too confidential, just scramble it before sharing thanks

Highlighted
Creator III
Creator III

Re: How to use a table fields twice in a pivot Table

Thank you I fixed the problem.

I duplicated  the factory and the region tables and renamed their fields names for the destination (destination factory table and destination region table).

Thank you very much.

Thanks to all.

Abdallah

Highlighted
Champion
Champion

Re: How to use a table fields twice in a pivot Table

You're welcome, don't forget to close the thread