Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
SCM
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
Vegar
Partner
Partner

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
Vegar
Partner
Partner

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