Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Error in load script!

Hey,

I am using mode() as follows but error is showing invalid expression.

Please help.

-----------------------------

Directory;

LOAD Id,

     StartDate,

     EndDate,

     Country,

     Type,

     Sub_Type,

     Name,

     Killed,

     Injured,

     Year,

     ModifiedTime,

    mode(Name) as CommonName

FROM

[Disaster_Data\Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster) Group By Name ;

Thnks

15 Replies
sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi Nikhil,

In your script you have added "Name" only in group by function.

whenever you are using group by function you have to add all the fields which you have used in load script.

-Sathish

maxgro
MVP
MVP

mode works in script and you can group by reading from an excel

you have to group by for all the fields without an aggr function

 

load c1, c2,

mode(Name)

FROM a.xlsx (ooxml, embedded labels, table is a)

group by c1, c2;

load c1 as c1new,

mode(Name)

FROM a.xlsx (ooxml, embedded labels, table is a)

group by c1;

anbu1984
Master III
Master III

Without using group by

Table:

LOAD Id,

     StartDate,

     EndDate,

     Country,

     Type,

     Sub_Type,

     Name,

     Killed,

     Injured,

     Year,

     ModifiedTime

 

FROM

[Disaster_Data\Copy of Disaster.xlsx]

(ooxml, embedded labels, table is Disaster)  ;

Left Join(Table)

Load mode(Name) as CommonName Resident Table;

nikhilgarg
Specialist II
Specialist II
Author

Hey,

THanks but is this constraint for group by in QLikview only ?? Becoz as far as i know no such constraint in sql....

anbu1984
Master III
Master III

You have same constraints in Sql which can be avoided by using Analytic functions

sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi Konstantins,

We can use aggregation function with excel files

-Sathish