Qlik Community

New to Qlik Sense

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

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
v_jaideep
Creator
Creator

If statement in Set analysis

Hi,

I need sum(sales) only when start date > approved date. How can I achieve this in set analysis .

@tresesco any suggestion

14 Replies
tresesco
MVP
MVP

Try like:

Sum({<Sales={"=StartDate=ApprovedDate"}>}Sales)

v_jaideep
Creator
Creator
Author

Tried above and this Sum({<startdate={">=approveddate"}>}sales)

Both did not work

AshutoshBhumkar
Partner
Partner

Hi,

As @tresesco suggested,

Sum({<Sales = {"=StartDate>ApprovedDate"}>}Sales)

Above expression should work

v_jaideep
Creator
Creator
Author

hello Ashutosh,

I get '0' when I use the above expression.it is not the syntax error when I say that "It doesn't work"

abhijitnalekar
Specialist
Specialist

Hi @v_jaideep ,

 

Check if both field date format is same.

Regards,
Abhijit
keep Qliking...
v_jaideep
Creator
Creator
Author

Yes, Date format are same.
I got this working when used in the backend and create a flag and using that flag in set analysis.
But now I want the whole condition in set analysis , so that I could save a 'Join' in the script.

abhijitnalekar
Specialist
Specialist

Can you share sample data or expression which you have used>

Regards,
Abhijit
keep Qliking...
maxgro
MVP
MVP

I think you need a Key field (you can create it with autonumber in the script) and then

Sum({<Key = {"=(StartDate> ApprovedDate)" } >} Sales)

v_jaideep
Creator
Creator
Author

Even this didn't work.😫

P.S: Above all options are not syntax errors just the data shown is '0 in my case.