Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

Previous () wrong values

Hi Folks,

i got a situation and my table does look like:

Project, Document, Status, NewStatus

A, 12, closed,  open

A, 13, open, open

B, 15, closed, closed

B, 15, closed, closed

 

i am trying to create the new Field: NewStatus by using the below coding

if(Project = previous(Project) and Document <> previous (Document) and Status = 'closed', 'open', Status)

as NewStatus,

but i didn't achieve the expected output.

 

Does anybody have any idea how to resolve this issue? Thanks a lot for any feedbacks and help in advance.

Bek

 

Labels (1)
4 Replies
JustinDallas
Specialist III
Specialist III

What's your expected output?

beck_bakytbek
Master
Master
Author

Hi Justin, thanks a lot for your reply and time, i am trying to build the new field with the help of above coding:

if(Project = previous(Project) and Document <> previous (Document) and Status = 'closed', 'open', Status) as NewStatus

 

please let me know if you need more information

JustinDallas
Specialist III
Specialist III

Can you show me a table of your beginning data, and a table of your desired data and maybe what it's giving you that you don't want.

beck_bakytbek
Master
Master
Author

Hi Justin thanks a lot again for your reply, this is my table:

Project, Document, Status, NewStatus

A, 12, closed,  open

A, 13, open, open

B, 15, closed, closed

B, 15, closed, closed

 

with the help of fields: Project, Documents and Status i am trying to build the new field: NewStatus, the coding you have seen above :

if(Project = previous(Project) and Document <> previous (Document) and Status = 'closed', 'open', Status) as NewStatus