Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Keitaru
Creator II
Creator II

Calculating new date based on created date + num

Hi 

I'm wondering if Qilk has something similar to excel where by 

I'm trying to define targeted date  from start date.

I know in excel its as easy as 

= startDate + <Number>

Basically trying to check if Priority = low/medium/high/critical of a record and calculate the targeted date based on when it started.

=if({<{[Priority*]={'Low'}>}[Problem ID*+],Date(Num(Timestamp#("Submit Date",'DD/MM/YYYY hh:mm:ss'))+365),
if({<{[Priority*]={'Medium'}>}[Problem ID*+],Date(Num(Timestamp#("Submit Date",'DD/MM/YYYY hh:mm:ss'))+180),
if({<{[Priority*]={'High'}>}[Problem ID*+],Date(Num(Timestamp#("Submit Date",'DD/MM/YYYY hh:mm:ss'))+90),
if({<{[Priority*]={'Critical'}>}[Problem ID*+],Date(Num(Timestamp#("Submit Date",'DD/MM/YYYY hh:mm:ss'))+30))))

What about in qlik and also trying to make this as a master dimension however keeps giving error in expression: "Error in expression: ')' expected"

 

1 Solution

Accepted Solutions
zzyjordan
Creator II
Creator II

if you want the new date, yes, you can use if as below:
If([Priority*]='Low',date(Num(Date#(datetime, 'DD/MM/YYYY hh:mm:ss'))+365.0))

ZZ

View solution in original post

5 Replies
zzyjordan
Creator II
Creator II

Hi, Keitaru
Have you tried this?
count({<[Priority*]={'Low'}>} date([Submit Date]+365))

ZZ
Keitaru
Creator II
Creator II
Author

Hi ZZ,

Tried that as well didnt seem to work.
Since my Current date format is in DD/MM/YYYY hh:mm:ss does it effect the calculation?
zzyjordan
Creator II
Creator II

Hi, Keitaru

Then try this
count({<[Priority*]={'Low'}>} date(Num(Date#(datetime, 'DD/MM/YYYY hh:mm:ss'))+365.0))

Hope this helps
ZZ
Keitaru
Creator II
Creator II
Author

yup it works however what i do really want to achieve is being able to have a table display the new Date in a cell based on the above and not display the count, thought abt using if but would pick match work as well? or is there any other ways?

zzyjordan
Creator II
Creator II

if you want the new date, yes, you can use if as below:
If([Priority*]='Low',date(Num(Date#(datetime, 'DD/MM/YYYY hh:mm:ss'))+365.0))

ZZ