Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am looking to make a sum of PrixVente when [Structure] ={'1174*'} and for the last year ,
the following expression returns wrong values , how to correct it ?
=if(IsNull(GetFieldSelections(Week,'*')),Sum({$<Year={$(=max(Year-1))}>}{<[Structure] ={'1174*'}>}PrixVente)
,Sum({$<Weekyear= {$(=max(Weekyear-1))}>}{<[Structure] ={'1174*'}>}PrixVente))
Try :
=if(IsNull(GetFieldSelections(Week)),Sum({$<Year={'$(=max(Year)-1)'} ,[Structure] ={"1174*"}>}PrixVente)
,Sum({$<Weekyear= {'$(=max(Weekyear)-1)'},[Structure] ={"1174*"}>}PrixVente))
HTH
Try :
=if(IsNull(GetFieldSelections(Week)),Sum({$<Year={'$(=max(Year)-1)'} ,[Structure] ={"1174*"}>}PrixVente)
,Sum({$<Weekyear= {'$(=max(Weekyear)-1)'},[Structure] ={"1174*"}>}PrixVente))
HTH
try this
=if(IsNull(GetFieldSelections(Week)),Sum({$<Year={$(=(max(Year)-1))}>}{<[Structure] ={'1174*'}>}PrixVente)
,Sum({$<Weekyear= {$(=(max(Weekyear)-1))}>}{<[Structure] ={'1174*'}>}PrixVente))
I think
=Sum( {$ <Year={$(=max(Year)-1)},Structure ={"1174*"}>} PrixVente)
same for WeekYear
The above posts correct the syntax error in your expression.
What is the format of Weekyear? Is it text or numeric? The QV Weekyear function returns a year value.
If weekyear means the week number in the year, then max(Weekyear) will not work correctly over the year end (week1 - 1 = week52 of prior year). You need to do proper date calculation - do you have a date field?
HI,
Try this:
=if(IsNull(GetFieldSelections(Week,'*')),Sum({<Year={'$(=max(Year)-1)'},[Structure] ={'1174*'}>}PrixVente)
,Sum({<Weekyear= {'$(=max(Weekyear)-1)'},[Structure] ={'1174*'}>}PrixVente))