Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LYTD sales

hi

everyone,

i am stuck in the formula to calculate LYTD sales, i want to apply set analysis in it.

any suggestions.

regards

vijit

Labels (1)
1 Solution

Accepted Solutions
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi Vijit,

If you select only year or date it will give you LYTD and if u select Month also then it will give LYMTD value

View solution in original post

5 Replies
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi Vinit,

You can use below formula where var1=Max(Year)-1 and var2=Date(Addmonths(Max(date),-12),'Format'). This will work for any date selection.

=Sum({$<[Clearing Year]={$(var1)}, Clearing_AUGDT={"(<=$(var2))"}>} [Amount in LC_DMBTR])

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Read [Clearign Year] as Year and Clearing_AUGDT as Date 

Not applicable
Author

hi vijay

thanx for your help but the formula provided by you gives only the sales of the maximum month last year.

I want the sales till date based on selection.

for eg:

if my maximum date is 30-11-2011 and maximum year is 2011.

then i want the sales of 2010 till november not only november.

hope you understand my problem.

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

I am using

If Year=LastYear and Date is less than lastyear todays date that means last YTD. the second condition is showing Date< = Todays date of last year. It is working fine for me and I am able to get the desired ressult. hope you have not selected any month in your filter.

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi Vijit,

If you select only year or date it will give you LYTD and if u select Month also then it will give LYMTD value