Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikcheepirishe
Creator
Creator

Last year march value in Last YTD

My requirement is to get  the last ytd

In last ytd it should display last year march value for the ytd below is the expression I am getting correct ytd can anyone guide me for the value to display on LAST YTD should display March value

YTD Expression=AVG(AGGR(AVG({1<FOR_DATE = {">=$(=DATE(YEARSTART(v_Date, 0, 4), 'DD/MM/YYYY'))"}, FOR_DATE = {"<=$(v_Date)"}>}Actual), Unit, KPI, UOM, Area, [Sub Area], Equipment))

Variables Used

v_Date=DATE(MAKEDATE(v_Max_Year, v_Max_Month), 'DD/MM/YYYY')

v_Max_Year==MAX(Year)

v_Max_Month =IF(GetSelectedCount(Month) <= 0, MAX(NUM_MONTH), NUM_MONTH) @

15 Replies
qlikcheepirishe
Creator
Creator
Author

01/04/2018 = output for v_Date

Max(NUM_MONTH) = 4

my requirement is basis on financial year wise so using(v_Date,0,4) which starts from 1st April

qlikcheepirishe
Creator
Creator
Author

due to variable change it is affecting other expressions such as ytd actual etc.

any other way for output

jyothish8807
Master II
Master II

But did the variable change worked for last YTD ?

Br,

KC

Best Regards,
KC
jyothish8807
Master II
Master II

Try this:


AVG(AGGR(AVG({1<FOR_DATE = {">=$(=DATE(AddYears(YEARSTART(v_Date, 0, 4),-1), 'DD/MM/YYYY')) <=$(=DATE(AddYears(v_Date,-1),DD/MM/YYYY'))"},Year=,NUM_MONTH=>}Actual), Unit, KPI, UOM, Area, [Sub Area], Equipment))

Best Regards,
KC
qlikcheepirishe
Creator
Creator
Author

no

Anil_Babu_Samineni

You can define same for outer analysis like

AVG({1<FOR_DATE = {">=$(=DATE(AddYears(YEARSTART(v_Date, 0, 4),-1), 'DD/MM/YYYY')) <=$(v_Date)"}>} NODISTINCT AGGR(AVG({1<FOR_DATE = {">=$(=DATE(AddYears(YEARSTART(v_Date, 0, 4),-1), 'DD/MM/YYYY')) <=$(v_Date)"}>}Actual), Unit, KPI, UOM, Area, [Sub Area], Equipment))


If nothing - I would suggest you to paste sample?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful