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: 
Not applicable

Set analysis before date + other conditions

The formula below is driving me insane

=sum({$<

       inv_YearValue={$(=year(today(1))-1)}

     , ProductGroupName = {"Widgets"}

     , inv_DateValue={'<=$("=Date(addyears(today(),-1))")'}

>}QTYINVOICED*ITEMQTY)

Basically need it to pull data for the previous year, but only until the same day last year as today.

The third condition (inv_DateValue={'<=$("=Date(addyears(today(),-1))")'}) is not having an affect on the data at all. Pulls through same results regardless.

Please help!

11 Replies
Not applicable
Author

Thanks - definitely going the right direction, though it isn't actually filtering out any data. For example, the oldest inv_DateValue is in 2013, though if i change the last condition to even inv_DateValue={"<=$(=Date(addyears(today(),-10)),'DD/MM/YYYY hh:mm:ss')"}

... it still doesn't filter out any data.

Do I have a correct understand of set analysis here - should all conditions have to evaluate to true to get the value out?

sasiparupudi1
Master III
Master III

your condition inv_YearValue={$(=year(today())-1)} is set to  last year always

sum({1<

       inv_YearValue=

     , ProductGroupName = {'Widgets'}

     , inv_DateValue={"<=$(=Date(addyears(today(),-1)),'DD/MM/YYYY hh:mm:ss')"}

>}QTYINVOICED*ITEMQTY)

hth

Sasi