Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to calculate YTD. For ex : If I select Month as Sep 2019 then I should get value from Jan-19 to Sep-19.
I have written below code for this
=$(vAmount(Month={">=$(=YearStart(Max(Month)))<= $(=Date(Max(Month)))"},items = {'cost_plus','profit_split','fee_spread'},_Region=,BU_CODE=))
the highlighted portion is for ytd calulation. but it is not working. could please assist what is going wrong in the formula.
in above is the screenshot of the same formula. in this before <= sign the default qlik functions are not highlighting in blue color like yearstart & max function is not highlighting in blue. after this sign the qlik functions are highlighting in blue.
is there any error in formula ?. Please note Month field is a text value not in date format.
Thanks.
Hi Sunny,
Thanks for your kind reply with solution.
If I want to calculate ytd based on variable then how the formula would be?
you can consider my formula
Month={">=$(=YearStart(Max(Month)))<= $(=Date(Max(Month)))"}
how I can replace a month with a variable which I have declared in variable declaration to calculate ytd