Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
dudumoscona
Contributor
Contributor

value in a new field based on date on another field

Hi,

I have a field that shows the date and in case the date is today or yesterday i would like to put in a new field sentnce "The date is today or yesterday based on that...."

 

how could i do it?

1 Solution

Accepted Solutions
sunny_talwar

That might be it... try this

If(Match(Floor(MakeDate(1988) + PURTRANSDATECDP/1440), Today(1), Today(1)-1), 'Waiting for interface run') as ReasonCDP,

View solution in original post

10 Replies
sunny_talwar

May be this

LOAD Date,
If(Match(Date, Today(), Today()-1), 'The date is today or yesterday based on that', 'N/A') as NewField
FROM ...;
dudumoscona
Contributor
Contributor
Author

If(Match(PURTRANSDATECDP, Today(), Today()-1), 'Waiting for interface run') as ReasonCDP,

didnt work 😞

sunny_talwar

Would you be able to share a list box with PURTRANSDATECDP field? Also, could you try this

 

If(Match(Floor(PURTRANSDATECDP), Today(), Today()-1), 'Waiting for interface run') as ReasonCDP,

This to make sure that we remove time component if PURTRANSDATECDP is a timestamp

 

dudumoscona
Contributor
Contributor
Author

still give no value (attached pic)

sunny_talwar

Can you try this

If(Match(Floor(PURTRANSDATECDP), Today(1), Today(1)-1), 'Waiting for interface run') as ReasonCDP,
dudumoscona
Contributor
Contributor
Author

thank you very much for your help, still doesnt work , i think it doesnt work maybe becouse my date field is calculated , im adding the calculation of the field .

 

same result "-" value

sunny_talwar

That might be it... try this

If(Match(Floor(MakeDate(1988) + PURTRANSDATECDP/1440), Today(1), Today(1)-1), 'Waiting for interface run') as ReasonCDP,
dudumoscona
Contributor
Contributor
Author

it working, in case i want to add another condetion if field is bigger than other?
exmaple in my pic 🙂

you are awsome!

dudumoscona
Contributor
Contributor
Author

sorry wrong picture, add new one