Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
New Contributor III

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
Highlighted
Contributor II

Re: Calculating new date based on created date + num

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
Highlighted
Contributor II

Re: Calculating new date based on created date + num

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

ZZ
Highlighted
New Contributor III

Re: Calculating new date based on created date + num

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?
Contributor II

Re: Calculating new date based on created date + num

Hi, Keitaru

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

Hope this helps
ZZ
Highlighted
New Contributor III

Re: Calculating new date based on created date + num

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?

Highlighted
Contributor II

Re: Calculating new date based on created date + num

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