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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
butter
Contributor
Contributor

Duplicate data / use data from another ID

Hi All,

I have searched and I don't think I am using the correct key words to get the solution I am looking for.

 

I have data in Table1 that looks like this:

LocationLine ProductValue
A1X1.23
A1X1.24
A1X1.22

 

I have data in Table2 that looks like this:

LocationLine ProductVolume
A1X100
A2Y200
A3Z300

 

When I run all of my loads, run calcs and put into a straight table , I am getting the following (correct) data:

LocationLine ProductVolumeAvg Value
A1X1001.23
A2Y200 
A3Z300 

 

The summary is correct and the data is loading correctly.  The problem is that my data sources are not perfect due to the back end systems.  In this case, "Line" is the problem.  I have the "values" being generated on a common production line, which is then split into three finishing lines.  

butter_0-1759180872781.png

How can I load or use the values from Line 1 on lines 2 &3?  I want the table to look like:

LocationLine ProductVolumeAvg Value
A1X1001.23
A2Y2001.23
A3Z3001.23

 

 

Essentially I want to load extra data or load it twice/three times.  It is NOT always a case where Line 1 = Line 2 = Line 3, so I want to be able to select when I do this...

Labels (2)
4 Replies
Vegar
MVP
MVP

How do you want to select this? Dynamicly in the app or when loading the the data?

You could do this in the script by configuring the relationship in a structured way and then adding that into the table2.

 

Like this:

Load

Location,

Line as ValueLine,

Product,

Value

From table1;

 

Load

Location,

Line,

Product,

Volume, 

<some logic based that defines which valueLine> as valueLine

From table2;

butter
Contributor
Contributor
Author

@Vegar I am ok to do this at loading time as you show above. 

 

I would assume the logic would be something like:

If ( location = 'A' AND ValueLine = '1', true, false)

 

for conditions of true, how to do I duplicate the data?

PrashantSangle

where have you calculated avg() front end or Script?

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
butter
Contributor
Contributor
Author

I am calculating the average in the script using a master item measure.  I am allowing the user to filter by a date range and then displaying the avg() in a straight table.