Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mshailaja
Contributor III
Contributor III

if condition

Hi all,

i have written if condition in the script ,  while debugging  with 10000  load i am not getting error,  but while i am doing full load i am getting error as invalid expression , Can anyon eplease help where i am going wrong

Thanks

18 Replies
ashok1203
Creator II
Creator II

then try to calculate the same in variables.

AAK
avinashelite

You need to include the PERSID ,NEW_STATUS, OLD_STATUS in the Group by Your forgetting the basic here


group by is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions.

groupbyfieldlist ::= (fieldname { ,fieldname } )

tamilarasu
Champion
Champion

Try this,


pre:

Load

Sum(If(NEW_STATUS='RE', Dur)) - Sum(If(WildMatch(NEW_STATUS,'SUPS','OP','CL',), Dur)) as Total_Resolved_Duration,

Sum(If(OLD_STATUS='OP' and NEW_STATUS ='ACK', Dur) as Response Time

Resident GRP

Group by PERSID;


Next time post your script in text format not as picture.

mshailaja
Contributor III
Contributor III
Author

if i am writing the Group by with

i am getting the duplicate values,  how to do

mshailaja
Contributor III
Contributor III
Author

The incident is repeating as you can see in the  screenshot start time and endtime ,old status and new status is repeating twice if am taking Group by  PERSID, NEW_STATUS, OLD_STATUS;

avinashelite

You always share only half of the information , I feel Group by is working fine but Duplication might be because of your join condition or the way you have associated the tables are wrong ..you need to share the complete script and app then only we can debug the issue

tamilarasu
Champion
Champion

Did you try my suggestion?

pre:

Load

Sum(If(NEW_STATUS='RE', Dur)) - Sum(If(WildMatch(NEW_STATUS,'SUPS','OP','CL',), Dur)) as Total_Resolved_Duration,

Sum(If(OLD_STATUS='OP' and NEW_STATUS ='ACK', Dur) as Response Time

Resident GRP

Group by PERSID;

mshailaja
Contributor III
Contributor III
Author

I have 2 tables with first asignment group and seconassignment group with  fields as

PERSID i have  linked with one more table which is having incident no's

thas the logic i have applied in the datamodel

avinashelite

remove the REF_NUM column and add PERSID and check the data set once ..share your app