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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Nolan
Contributor III
Contributor III

Creating new fields on existing QVD

Hello,

I currently have a QVD file with the following script:

LOAD
"Day",
"Location",
DOH,
"Ending Inventory",
ID,
"In Transit",
"Lost Sales",
"On Order",
"Product Desc",
Receipts,
Sales

FROM [lib://QVD Storage (ngavin)/INVHIST.qvd]
(qvd);

After initially loading this script into the app, I have been able to create this new field and subsequently load it as well: 

"Location" & "Product Desc" as LocationProdKey

 

I am currently trying to add another field, but am running into an error titled 'Invalid Expression'

The new field I'm trying to add is : 

Max("Day") as "MaxDay"

 

Is there a reason I am not able to add this 'MaxDay' field the same way I did the 'LocationProdKey'?

 

Thanks in advance

Nolan

Labels (2)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

When you use Aggregate function you have to declare the group by for all non aggregate fields. Perhaps you can try this way

Table:

LOAD
"Day",
"Location",
DOH,
"Ending Inventory",
ID,
"In Transit",
"Lost Sales",
"On Order",
"Product Desc",
Receipts,
Sales

FROM [lib://QVD Storage (ngavin)/INVHIST.qvd]
(qvd);

Left Join (Table)

Load Max(Day) as MaxDat Resident Table;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Anil_Babu_Samineni

When you use Aggregate function you have to declare the group by for all non aggregate fields. Perhaps you can try this way

Table:

LOAD
"Day",
"Location",
DOH,
"Ending Inventory",
ID,
"In Transit",
"Lost Sales",
"On Order",
"Product Desc",
Receipts,
Sales

FROM [lib://QVD Storage (ngavin)/INVHIST.qvd]
(qvd);

Left Join (Table)

Load Max(Day) as MaxDat Resident Table;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Nolan
Contributor III
Contributor III
Author

Thank you so much!