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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
orangebloss
Creator
Creator

Only returning data where field value is equal to Variable

I am wanting to return a sum only when the value in the dimension is equal to a variable but it's not working as expected.

The variable (vCurrentYYYY/WW)  is 

=max({$<[DateIsland.Date]={'$(vToday)'}>} [DateIsland.Year]) &'/'& num(max({$<[DateIsland.Date]={'$(vToday)'}>} [DateIsland.Week]),'00')

and returns (for the current week) 2025/21

The dimension 'MPR YYYY/WW' contains data in the same format so I would expect that by using the following (where Alloc is a number) that it would only return the sum for the matching week?

 

Sum(${<[MPR YYYY/WW]={'$(vCurrentYYYY/WW)'}>} Alloc)

 

but it is returning every week

orangebloss_0-1747988279150.png

How can I get it to return just the current week total?

 

Labels (4)
2 Replies
marcus_sommer

A set analysis is quite the same as a selection - and if the search-string doesn't fit to any field-value no selection could be applied respectively the attempt is imply ignored.

Personally I would tend to simplify the task and skipping the variables because it looked that they cause more efforts and complexity as benefits and using instead an expression like:

sum({< YearWeek = p({< Island.Date = {"$(=today())"}>} Island.YearWeek)>} Value)

Qrishna
Master
Master

Mind sharing some sample data?