Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

how simply my script

 

1st function  (find the last date for last month)

date((date(date(floor(monthend(addmonths(Today(),-1))),

2nd function ( to calculate diff between month of previous month and booking date for calculate the Aging)

date((date(date(floor(monthend(addmonths(Today(),-1))),
'DD/MM/YYYY'),'DD/MM/YYY')-date("Pstng Date",'DD/MM/YYYY')),'M') as 'AGING',

my question is there anyway to simplify my 2nd  function, can i do it without copy paste whole 1st function 

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: how simply my script

Function 1 simplified:
Dayname(monthend(Today(),-1))

You can not reuse the output of a field inside the same LOAD, you will need to re-write the expressing. You can however use presiding load.
LOAD
*,
monthenddate - DateField
;
Load
DateField,
Dayname(monthend(Today(),-1)) as monthenddate
FROM ...
;
Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

1 Reply
Highlighted
Partner
Partner

Re: how simply my script

Function 1 simplified:
Dayname(monthend(Today(),-1))

You can not reuse the output of a field inside the same LOAD, you will need to re-write the expressing. You can however use presiding load.
LOAD
*,
monthenddate - DateField
;
Load
DateField,
Dayname(monthend(Today(),-1)) as monthenddate
FROM ...
;
Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post