Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
Zahmed14
Contributor III
Contributor III

Max date in data load and in chart

Hello Guys , 

am new to qlik ,  i have hana model which i load data from ,  what i need is to get the latest date in data load and also in charts 

i wrote below but give me error that  PHD_CERT1 not found


PHD_CERT1 :
Load
"PARTNER",
"OBJNR",
"RECNTYPE",
"TXT04",
"BEZ30",
"ZZFULL_NAME_ENG",
"NATIO50",
"CHDAT",
"Contract_Count" ;

Max("CHDAT") as Maxdate Resident PHD_CERT1
Group By "OBJNR","PARTNER","TXT04","BEZ30","ZZFULL_NAME_ENG","NATIO50","Contract_Count";

 

SQL SELECT "PARTNER",
"OBJNR",
"RECNTYPE",
"TXT04",
"BEZ30",
"ZZFULL_NAME_ENG",
"NATIO50",
"Contract_Count",
"CHDAT"

FROM "_SYS_BIC"."XXX.projects.XXX_Datamart/CV_RECN"
where "RECNTYPE" = 'ZH12' and "ZZFULL_NAME_ENG" <> '' ;

 

Also please advise  how to write in chart function 

Labels (2)
1 Solution

Accepted Solutions
lironbaram
Partner
Partner

yes something small is missing 

maxDate:
Load
Max("CHDAT") as Maxdate Resident PHD_CERT1
Group By "OBJNR","PARTNER","TXT04","BEZ30","ZZFULL_NAME_ENG","NATIO50","Contract_Count";

View solution in original post

12 Replies
lironbaram
Partner
Partner

Hi 
the error is because of this part 

Max("CHDAT") as Maxdate Resident PHD_CERT1
Group By "OBJNR","PARTNER","TXT04","BEZ30","ZZFULL_NAME_ENG","NATIO50","Contract_Count";

 

your script should be like that 

PHD_CERT1 :
Load
"PARTNER",
"OBJNR",
"RECNTYPE",
"TXT04",
"BEZ30",
"ZZFULL_NAME_ENG",
"NATIO50",
"CHDAT",
"Contract_Count" ;

SQL SELECT "PARTNER",
"OBJNR",
"RECNTYPE",
"TXT04",
"BEZ30",
"ZZFULL_NAME_ENG",
"NATIO50",
"Contract_Count",
"CHDAT"

FROM "_SYS_BIC"."XXX.projects.XXX_Datamart/CV_RECN"
where "RECNTYPE" = 'ZH12' and "ZZFULL_NAME_ENG" <> '' ;

maxDate:
Max("CHDAT") as Maxdate Resident PHD_CERT1
Group By "OBJNR","PARTNER","TXT04","BEZ30","ZZFULL_NAME_ENG","NATIO50","Contract_Count";

in chart you'll use the same function max(CHDAT)

Zahmed14
Contributor III
Contributor III
Author

It gives me this error , am i missing somthing there ?
 
The following error occurred:
Unknown statement: maxDate: Max("CHDAT") as Maxdate Resident PHD_CERT1 Group By "OBJNR","PARTNER","TXT04","BEZ30","ZZFULL_NAME_ENG","NATIO50","Contract_Count"
lironbaram
Partner
Partner

yes something small is missing 

maxDate:
Load
Max("CHDAT") as Maxdate Resident PHD_CERT1
Group By "OBJNR","PARTNER","TXT04","BEZ30","ZZFULL_NAME_ENG","NATIO50","Contract_Count";

View solution in original post

Zahmed14
Contributor III
Contributor III
Author

The following error occurred:
Table 'PHD_CERT1' not found
 
why he cant see the table 
lironbaram
Partner
Partner

do you have other tables in the script with the same fields?

 

Zahmed14
Contributor III
Contributor III
Author

No other tables  , just this one ..   any clue

lironbaram
Partner
Partner

Hi , if your run just the first part of loading the PHD_CERT1

do you have a table with data and with that name

Zahmed14
Contributor III
Contributor III
Author

I just have a  hana model that i selected field from  and include the load statment and i run .  its my first run

lironbaram
Partner
Partner

what is the result of running this part of the conde only.

 

PHD_CERT1 :
Load
"PARTNER",
"OBJNR",
"RECNTYPE",
"TXT04",
"BEZ30",
"ZZFULL_NAME_ENG",
"NATIO50",
"CHDAT",
"Contract_Count" ;

SQL SELECT "PARTNER",
"OBJNR",
"RECNTYPE",
"TXT04",
"BEZ30",
"ZZFULL_NAME_ENG",
"NATIO50",
"Contract_Count",
"CHDAT"

FROM "_SYS_BIC"."XXX.projects.XXX_Datamart/CV_RECN"
where "RECNTYPE" = 'ZH12' and "ZZFULL_NAME_ENG" <> '' ;