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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

condition error

Hi,

When i using following script it gives exectution error please help me,

load 'Repeat Callers' as desc,CallDate_Date as mon, num(count(DISTINCT CLI),'#,##0.00;(#,##0.00)') as measure

resident test

where count(CLI)>1

group by CallDate_Date;

Thanks,

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

Aggregation function cannot be used in where clause.

In Sql, Having clause can be used to give condition using aggregtion function.

In qlikview you can use preceding load as below

Load desc,mon,num(measure,'#,##0.00;(#,##0.00)') as measure where measure > 1;

load 'Repeat Callers' as desc,CallDate_Date as mon, count(DISTINCT CLI) as measure

resident test

group by CallDate_Date;

View solution in original post

8 Replies
tresesco
MVP
MVP

Remove '(' from format, and try:     '#,##0.00;(#,##0.00)

PrashantSangle

Hi,

Apply tresseco solution, It will work for you.

But I just want to know

how can your count goes on negative?

because in this #,##0.00;(#,##0.00) format the () format execute if value goes on -ve.

so if not required remove it from your formating.

try like

num(count(DISTINCT CLI),'#,##0.00') as measure

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

Hi tresesco,

Thanks for your reply.After removing of '( ' also its not working.

  load 'Transfered' as desc,CallDate_Date as mon, num(count(CALLINFO_SESSIONID),'#,##0.00;(#,##0.00)') as measure

resident test

where DISPOSITION = 'XA'

group by CallDate_Date;

this script working fine

but followiing script its not working fine.I think its problem in where count(CLI)>1

load 'Repeat Callers' as desc,CallDate_Date as mon, num(count(DISTINCT CLI),'#,##0.00;(#,##0.00)') as measure

resident test

where count(CLI)>1

group by CallDate_Date;

Please help me,

Thanks,

avinashelite

Yes that's the issue. first get the count without where condition. Then use resident load with your condition this should work

Anonymous
Not applicable
Author

Hi max ,

Thanks for your reply,

After removing -ve data its not working.

Please help me.

Thanks,

tresesco
MVP
MVP

chandini c wrote:

but followiing script its not working fine.I think its problem in where count(CLI)>1

You are right. 

Try like:

Temp:

load

      'Transfered' as desc,CallDate_Date as mon, num(count(CALLINFO_SESSIONID),'#,##0.00;(#,##0.00)') as      measure,

     Count(CLI) as Flag

resident test where DISPOSITION = 'XA' group by CallDate_Date;

Final:

Load

          measure

Resident Temp where Flag>1;

Drop table Temp;

anbu1984
Master III
Master III

Aggregation function cannot be used in where clause.

In Sql, Having clause can be used to give condition using aggregtion function.

In qlikview you can use preceding load as below

Load desc,mon,num(measure,'#,##0.00;(#,##0.00)') as measure where measure > 1;

load 'Repeat Callers' as desc,CallDate_Date as mon, count(DISTINCT CLI) as measure

resident test

group by CallDate_Date;

Anonymous
Not applicable
Author

Hi anbu,

  Thanks for your reply its working for me..

Thanks,