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: 
Stefan_Weber
Contributor III
Contributor III

Problems in Load statement

Hello Qlikview Community,

I am trying to load data from different sources into my Qlikview File: in the following I try to describe what I am doing:

1) Loading Data from an SQL Database in a Qlikview Table (Data_Raw)

2) With this data I try to do calculations

Data_SegmentData:
LOAD
AssetKey,
ProductionSegmentID,
PVKey,
timestamp(min(left(ProductionStartTime,19))) as ProductionSegmentStart,
min(left(ProductionStartTime,19)) as ProductionSegmentStartNumber,
timestamp(max(left(ProductionEndTime,19))) as ProductionSegmentEnd,
Interval(max(left(ProductionEndTime,19)) - min(left(ProductionStartTime,19)), 'hh:mm') as ProductionSegmentDuration,
if(Sum(if(AEProductionCategoryKey = 'OAE Prod',ProductionQty))>0,Interval(max(left(ProductionEndTime,19)) - min(left(ProductionStartTime,19)), 'hh:mm')) as ProductionSegmentDurationProd,
if(Sum(if(AEProductionCategoryKey = 'OAE Prod',ProductionQty))>0,round(Sum(if(AEProductionCategoryKey = 'OAE Prod',ProductionQty)),0.01)) as ProductionSegmentQuantity,
if(Sum(if(AEProductionCategoryKey = 'OAE Prod',ProductionQty))>0,round(Sum(if(AEProductionCategoryKey = 'OAE Prod',ProductionQty)),0.01) /(Interval(max(left(ProductionEndTime,19)) - min(left(ProductionStartTime,19)), 'hh:mm')*24)) as ProductionSegmentmmax


resident Data_Raw group by ProductionSegmentID;

 

this statement is not working, because the AssetKey and PVKey are not part of the group by clause (at least that is what I think)

When trying to join load this information, Qlikview is generating Syn Tables (AssetKey/PVKey/ProductionsegmentID) which is not what I want.

Is there a way to get the information AssetKey and PVKey in the above mentioned table ?

Maybe by loading a combination of AssetKey_PVKey_ProductionSegmentID in each Table ?

Or is there an alternative ?

Thanks

Stefan

 

 

 

1 Reply
Stefan_Weber
Contributor III
Contributor III
Author

Hello community,

 

since AssetKey and PVKey just occur once per ProductionSegmentID I could include them in the group by clause.

Sometimes the simplest solution is the right one.

Thanks for taking the time and looking at this topic.

Regards

Stefan