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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
userid128223
Creator
Creator

set analysis or if help

I have a input box that defines sales limit.

I am trying to get total sales restricting by past 3 months from current date (today). + restrict by above input box. Below is what i did without sucess.

=sum({<user={doug},ReadingDate = {'>=$(=ADDMONTHS(TODAY(),-03))'}>}sales)

I put a dimension limit "show only value that are greter  use the variable name for input box.

however the above is not work. Please let me know what could be the issue.

ReadingDate format = YYYY-MM-DD    (could this format be creating an issue)

How can i achieve the above via if statement. What is better using if or set analysis.



1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try =sum({<user={'doug'},ReadingDate={'>=$(=date(ADDMONTHS(TODAY(),-3)))'}>}sales)

If that doesn't work please read Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try =sum({<user={'doug'},ReadingDate={'>=$(=date(ADDMONTHS(TODAY(),-3)))'}>}sales)

If that doesn't work please read Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand
userid128223
Creator
Creator
Author

Thanks Gysbert.

This worked after I adjusted my date format. i think that was the main issue.

  1. if you were to find out past 40 days instead of 3 months how would you adjust the formula.
  2. Can this formula be done wiht if statement, is if prefered over setanalysis.
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

1. simply subtract 40 days from today: date(today()-40)

2. a set analysis expression is to be prefered over an if statement, i.e. takes less cpu time to calculate.


talk is cheap, supply exceeds demand