Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
ramyasaiqv
Creator II
Creator II

Need Help with Expression

I’m trying to calculate the number of Days the Oder is Open for the orders which have 

Type= ‘BCT’ and Status=’Accepted’ (no ECT status at all) and Type=’ECT’ and Status=’Open’

Expression to count the number of orders which have   Type= ‘BCT’ and Status=’Accepted’ (no ECT status at all) and   Type=’ECT’ and Status=’Open’

Count({<[ID]=P({<[Type]={'BCT'},[Status]={Accepted}>})*
P({<[Type]={'ECT'},[Status]={Open}>+<[ID]={"=Count([ID]) = 1"},[Type]={'BCT'},[Status]={Accepted}>})>} DISTINCT [ID])

I’m trying to tweak this expression to get the number of Open Days and need help please help me.

# Days Open = (Today()- Date (Approved)

Please can someone help me with the expression.

Thank you,

Ramya

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi,

may be this

Today()-Only({<[ID]=P({<[Type]={'BCT'},[Status]={Accepted}>})*
P({<[Type]={'ECT'},[Status]={Open}>})+P({<[ID]={"=Count([ID]) = 1"}>})>} DISTINCT Date)-1

Regards,

Antonio

View solution in original post

7 Replies
antoniotiman
Master III
Master III

Hi,

may be this

Today()-Only({<[ID]=P({<[Type]={'BCT'},[Status]={Accepted}>})*
P({<[Type]={'ECT'},[Status]={Open}>})+P({<[ID]={"=Count([ID]) = 1"}>})>} DISTINCT Date)-1

Regards,

Antonio

ramyasaiqv
Creator II
Creator II
Author

Thank you Antonio, really appreciate it.

ramya

ramyasaiqv
Creator II
Creator II
Author

Hi Antonio,

I'm sorry when i did complete testing my data i found some issue with the above expression. If you get a chance please can you help me with the attached.

Issue:

In the attached qvw there shouldn't any data for Orders  PTC  and Type= ECT because ECT status= Accepted and also Oder MEC, Type=BRD' and Status='Accepted'.

Requirement:     calculate the number of Days the Oder is Open for the orders which have

Type= ‘BCT’ and Status=’Accepted’ (no ECT status at all) and Type=’ECT’ and Status=’Open’

I have attached the qvw, excel and expected result set.  Please help me

Regards,

Ramya

antoniotiman
Master III
Master III

There's no 1100DESC in Your input data

ramyasaiqv
Creator II
Creator II
Author

Hi Antonio,

Sorry it was my mistake it's 445 DESC, i have updated the corrected file. When you get a chance please help me. Thank you,

Ramya

antoniotiman
Master III
Master III

See Attachment

ramyasaiqv
Creator II
Creator II
Author

Thank you so much Antonio.

Ramya