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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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 - Specialist
Partner - Specialist

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 II
Specialist II

Hi @v_jaideep ,

 

Check if both field date format is same.

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
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 II
Specialist II

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

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
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.