Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Error in Following script !!

Hello,

Something going wrong in my following script. Please tell me where it is wrong.

Data1:


LOAD Months,

     Value,

     MissingCount(Item) as CountOfMissingItem

FROM

(ooxml, embedded labels, table is Sheet1) Group By Months ;

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

Months and Item are Characters and Value are Numeric.  In Item field i have put some values empty.

Thanks

1 Solution

Accepted Solutions
tresesco
MVP
MVP

The source table you have:

Screen Shot 11-17-14 at 01.06 PM.PNG.png

And you are counting missing value for Item(and not Value) field and they are missing at position for Months Mar and Apr. It is fine, I see.

Screen Shot 11-17-14 at 01.09 PM.PNG.png

View solution in original post

15 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Remove group by clause

LOAD Months,

     Value,

     MissingCount(Item) as CountOfMissingItem

FROM

(ooxml, embedded labels, table is Sheet1) ;

Regards

ASHFAQ

sushil353
Master II
Master II

Hi,

the no of field in load/select statement should included in group by clause.. so add Value in your Group by as

Group by Month, Value;

HTH

Sushil

tresesco
MVP
MVP

You have to take all dimensions in the load (except for the one used in aggregation function) under group by clause like:

Group By Months, Value;

nikhilgarg
Specialist II
Specialist II
Author

HEy,

Without GroupByClause , MissingCount will not work .

nikhilgarg
Specialist II
Specialist II
Author

Hey,

IT works but i could not get what this MissingCount() function returns ??

I thought it will return numeric value(1 , 0) corresponding to other columns where values are missing.

Please explain.

ashfaq_haseeb
Champion III
Champion III

If it is function then add other fields to group by clause.

if not then

Try below

LOAD

  Months,

     only(Value) as Value,

     MissingCount(Item) as CountOfMissingItem

FROM

(ooxml, embedded labels, table is Sheet1) Group By Months ;

Regards

ASHFAQ

nikhilgarg
Specialist II
Specialist II
Author

Hey,

I just want to know that if we have 'n' no of dimensions then in GroupByClause we have to take 'n-1' dimensions ??

Is it so ??

ashfaq_haseeb
Champion III
Champion III

you can use only function as shown above to avoid adding dimension to groupby clause.

Regards

ASHFAQ

tresesco
MVP
MVP

You are right, it returns numeric value. Issue could be somewhere else, like, an understanding-gap between your expectation and our understanding. Hence, try to share a sample data and explain the expected output.