Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Script Error

HEy,

I am using following script but it is giving me error as Invalid Expression:

Table3:

LOAD

Item1,

Item2,

Item3,

Count(Item4) as #Item

Resident Table1 Group By Region;

What is the issue??

tHanks

27 Replies
nikhilgarg
Specialist II
Specialist II
Author

Hey,

I cann't paste script bcoz my project is on VDI. ANyways, will this help u??

Table1:

LOAD

Item1,

Item2,

Item3,

Dim1;

RightJoin(Table1)

Load

Dim2,

Dim3,

Dim4,

Item1;

Now i ahve to load dat data on which count is to be made:

Load

Dim1,

Item 4, // On which count is to be made

Item5;

Now, I want to Count(Item4) making GroupBy clause with Dim1 ,Dim2, Dim3 , Dim4.

How can i do this??

sunny_talwar

Hey Nikhil your right join is not going to be very helpful bro. You have no common fields between the two.

Table1:

LOAD

Item1,

Item2,

Item3,

Dim1;

RightJoin(Table1)

Load

Dim2,

Dim3,

Dim4,

Item1;

Guys, correct me if I am wrong, but for his right join to work the way I am hoping he want it to work, he would need to have something in common, right?

Best,

S

nikhilgarg
Specialist II
Specialist II
Author

Hey,

In both he tables, Item1(column name) is common.

sunny_talwar

My bad, you are right.

nikhilgarg
Specialist II
Specialist II
Author

Hey,

But this will create a synthetic key , isn't it

nikhilgarg
Specialist II
Specialist II
Author

Ohk then plz guide me how can i acheive my goal from last reply

sunny_talwar

Try this:


Table1:

LOAD Item1,

          Item2,

          Item3,

          Dim1

FROM XYZ;

Right Join (Table1)

LOAD Dim2,

          Dim3,

          Dim4,

          Item1

FROM ABC;

Left Join (Table1)

LOAD Dim1,

          Item4, // On which count is to be made

          Item5

FROM DEF;

Join (Table1)

LOAD Dim1,

          Dim2,

          Dim3,

          Dim4,

          Count(Item4) as [Item 4 Count]

Resident Table1

Group By Dim1, Dim2, Dim3, Dim4;

Best,

S

nikhilgarg
Specialist II
Specialist II
Author

All column values for Table which has column(on which count is to be done) is not coming

It is giving Count(Item4) as 0

And why do we use Join(Table1) at last ??

sunny_talwar

So that you don't have a synthetic key in your data structure. You just responded to Renjith Pl, that you wouldn't want to see a synthetic key. So I wondered it would be ideal if we join the whole thing back to the original table.

Best,

S

nikhilgarg
Specialist II
Specialist II
Author

I didn't get you. DO you have any idea how to acheive what i want??

tHanks