Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
SCM
New 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
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
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