Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
dineshm030
Creator III
Creator III

Values are not coming for some records by using IF statement

Hi All,

Both measures are the same. But the 1st measure shows all values whereas the 2nd shows only two products value.

1st Expression:

Sum({<Version_Desc = {'Actual','Adjustment'},ContinuousDay = {"<=$(=max(ContinuousDay))"}, YearOffset = {"$(=max(YearOffset)-1)"},Year,Month,Date_Key,Day_of_Week>}Sales_Value)/1000

2nd Expression:

If(Day_of_Week = 10,
Sum({<Version_Desc = {'Actual','Adjustment'},ContinuousDay = {"<=101"}, YearOffset = {"$(=max(YearOffset)-1)"},Year,Month,Day_of_Week>}Sales_Value)/1000)

dineshm030_0-1681178017367.png

Could you please help me out.

Thanks in advance @marcus_sommer @MayilVahanan @sunny_talwar 

2 Replies
marcus_sommer

Both expressions are not the same. I assume that in both cases the ContinuousDay <= 101 - one time calculated and one time as fixed value - but the second aggregation is included within another expression - the if-loop - and of course this will have an impact.

Sabrina_V
Partner - Creator II
Partner - Creator II

I'm agree with @marcus_sommer  The two formulas are not the same.

On the first one, you used a variable to filter the field ContinuousDay.

On the last one, you fixed a value 101 and you added a condition on another field Day_of_Week.

What are the rules you need to apply ?