Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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
sunny_talwar

Try and see if this works

Table3:

LOAD

Region,

Count(Item4) as #Item

Resident Table1

Group By Region;

Best,

S

puttemans
Specialist
Specialist

Hi,

I think you need to instruct more on the grouping, and you need to add Region in the variable list.

So it would look like :

Table3:

Item1,

Item2,

Item3,

Count(Item4) as #Item,

Region
Resident Table 1

Group by Region, Item1, Item2, Item3;

You now ask to group on a variable that is not there, and if it's there, then QV still has too many variables open.

Not applicable

1. You do not have Region in your table

2. Aggration will only work if you have all items some thing like

Table3:

LOAD

Item1,

Item2,

Item3,

Count(Item4) as #Item

Resident Table1

Group By

Item1,

Item2,

Item3

;

nikhilgarg
Specialist II
Specialist II
Author

It is giving me Syntax Error

puttemans
Specialist
Specialist

can you post your syntax?

sunny_talwar

What exactly are you trying to accomplish?? It would be easier if we know your ultimate goal.

Best,

S

nikhilgarg
Specialist II
Specialist II
Author

Well,

I have a pivot table with 4 dimensions. I added a expr to count values of a other dim.

Now , i ahve to cross check dat the count in pivot tables should be same when directly fetching from sql.

So, in that case i have to put GroupBy clause on every Dim used in pivot, ryt?

Table1:

Dim1 , dim2 ,dim3 are in one table and dim4 in other table.

So, i load dim1 , dim2 , dim3 from one table and right join Load dim4 from other table.

LeftJoin:

Now i have loaded Dim5 on which i have to put count functIOn.

Now i ahve Complete Table1. I used Resident table function as:

Table3:

LOAD

Dim1, Dim2, Dim3, Dim4 , Count(Dim5) as #Item Resident Table1 Group By Dim1, Dim2 , Dim3 , Dim4


But i am having Syntax Error

sunny_talwar

Does your Table1 with dim1, dim2 & dim3 have anything common with your second table which contains dim4 (Does it have dim1, dim2 or dim3) The reason I ask this is because if nothing is common then your right join will completely empty your dim1, dim2 & dim3.

You will need to give us more than this. Can you paste your actually script?

Best,

S

renjithpl
Specialist
Specialist

May be this solves,

Table_New:

Noconcatenate LOAD

Dim1, Dim2, Dim3, Dim4, Count(Dim5) as #Item

Resident Table1 Group By Dim1, Dim2 , Dim3 , Dim4;

Drop table Table1;

Thanks

Ren