Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sarasunagaram
Partner - Contributor II
Partner - Contributor II

Set expression problem

Hi All,

Set expression is not working properly ,it is giving zero values.

vperiod-SubField(PeriodWeek,'-',2)

Exp: sum({<Period={"$(vperiod)"}>}Sales)

Please find the attached app an data.

Thanks in Advance.

Muni

15 Replies
sarasunagaram
Partner - Contributor II
Partner - Contributor II
Author

Hi Rakesh ,

I have some other filters in my set expression.how can give those as well.

boorgura
Specialist
Specialist

if they are based on Period week, adjust the if condition accordingly. Else, you can combine the  if with a set expression.

SUM({<set_expression>} if(condition, Sales)

OR

SUM(if(condition_1 and condition_2, Sales)

sarasunagaram
Partner - Contributor II
Partner - Contributor II
Author

This is the sum({$<Period ={"<=$(=Only({<Week,Month>}subfield(PeriodWeek,'-',2) ))"}>} Sales)  expression using in my chart

boorgura
Specialist
Specialist

what exactly are you trying to achieve here?

sarasunagaram
Partner - Contributor II
Partner - Contributor II
Author

here regardless of my week and month show data according to that row period. my dimension is periodweek. Problem is period is not able  to compare with sub field value.

boorgura
Specialist
Specialist

please confirm - if this is what you want.

If period is 03,06,09 or 12  sum(Sales)/5 else sum(Sales)/4.

That's it? Or any other criteria?