Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
lylererger
Creator II
Creator II

Set Anayls LY Period Problem

Hi.

Help me to understand why that formula is not woking:


=SUM({<Date={'>=$(=addyears(min({<[Operation ID]={1}>}Date),-1))<=$(=addyears(max(TOTAL{<[Operation ID]={1}>}Date),-1))'}>}[# Sales Amount])

Thnx.

1 Solution

Accepted Solutions
lylererger
Creator II
Creator II
Author

Whether there can be it because I filled emptiness with text values? !

View solution in original post

7 Replies
MK_QSL
MVP
MVP

What you want to achieve?

SUM({<Date = {">=$(=AddYears(Min(Date),-1))<=$(=AddYears(Max(Date),-1))"}, [Operation ID]={1}>}[# Sales Amount])


lylererger
Creator II
Creator II
Author

Sales for the previous period.

Your formula is not working!

Formula of sales for the current period
=SUM({<Date={'>=$(=min({<[Operation ID]={1}>}Date))<=$(=max(TOTAL{<[Operation ID]={1}>}Date))'}>}[# Sales Amount])

Operation ID = 1 it's dates of Sales. I've got the quota and budget's where Operation ID = 2 and 3.

I just need the sales for the previous period (Last Year)

But that formula isn't working (((
=SUM({<Date={'>=$(=addyears(min({<[Operation ID]={1}>}Date),-1))<=$(=addyears(max(TOTAL{<[Operation ID]={1}>}Date),-1))'}>}[# Sales Amount])

It's looks like so easy task. But i still have no any idea how to solve it.

Help...

MK_QSL
MVP
MVP

Better if you can provide little data also. this could make our task of giving answer easy.

lylererger
Creator II
Creator II
Author

It's not possible. I'm working on the clients server and can't copy any data.
Private security policy.

May be any advice. Any errors in script?

MK_QSL
MVP
MVP

You can obviously create a dummy data in excel file.

Keep only related fields of your requirements and of having same format.

We need only 15-20 rows with Date, Operation ID, Sales Amount and also using those data, kindly provide what is the output result you wants.

We should be very accurate while using Dates in Set Analysis. The comparison should be between same format.

Also, just want to know why you are using TOTAL Qualifier...

lylererger
Creator II
Creator II
Author

Whether there can be it because I filled emptiness with text values? !

MK_QSL
MVP
MVP

What output you expecting?