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: 
capriconuser
Creator
Creator

Group by in script

 I am trying to load script with group by and fetch current date by Today() function .. here is what i load the script 

 

PO:
Qulaify *;
Unqualify %Key;

Load

Today() as current_Date,
[applicat ac] as account_no,
[co code] as %Key,
ID as Refrence,
IF(Left(ID,2)='PO','PO',NULL()) AS PO,
[Code Bra] as Code_Bran
Date(Date#([ISS DATE],'yymmddhhmm')) as DATE,
sum([iss amount]) as ISS_AMOUNT
from 
[..\Extraction\po_table] (qvd)
group by 
current_Date, [applicat ac], [co code], ID, [Code Bra] , [ISS DATE] , [iss amount];

Store PO into PO(qvd);
Unqualify ;

Now here when i load the script this shows that Field "Current_Date" not found and here i aliases this field on Today() function 

secondly when i comment this Today() function from load and group by then error occurred " Invalid expression" and not exactly mentioned where invalid expression is 

 

any help about this ?

 

 

3 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Use this:
Group By
Today(), [applicat ac], [co code], ID, IF(Left(ID,2)='PO','PO',NULL()), [Code Bra], Date(Date#([ISS DATE],'yymmddhhmm'))
capriconuser
Creator
Creator
Author

for this "Date(Date#([ISS DATE],'yymmddhhmm'))" can we use just ISS DATE?

and what this sum([iss amount]) as ISS_AMOUNT ? in database [iss amount] data type is varchar so i convert to int in script ?
shiveshsingh
Master
Master

Try with Resident load instead, your alias will work in group by then