Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arusanah
Creator II
Creator II

Set Analysis Help

Hi Qlikers ,can any one help me find error in this expression . Individually all fn's including concate fn() works fine but when I use it in set analysis it doesn't work .I know I am missing something very small maybe an comma or ' " ' ,in Date condition , which I'm not able to find .

Any help will be highly appreciated

if((Sum({$<Date={$(='"'&concat(distinct date(Addmonths(Date,-(if(getselectedCount(Date)=0,1,getselectedCount(Date)))) ,'MMM-YYYY'),'","')&'"')}>}Value)

3 Replies
andrey_krylov
Specialist
Specialist

Try this

Sum({$<Date={$(=Chr(39)&concat(distinct date(Addmonths(Date,-(if(getselectedCount(Date)=0,1,getselectedCount(Date)))) ,'MMM-YYYY'),Chr(39)&Chr(44)&Chr(39))&Chr(39))}>}Value)

balabhaskarqlik

May be Set Analysis expression like this:

Sum({$<Date=

{"$(=date(Addmonths(Date,-"$(if(getselectedCount(Date)=0,1,getselectedCount(Date)))"),'MMM-YYYY'))"}

>}Value)

karthiksrqv
Partner - Creator II
Partner - Creator II

Hi,

The date() formatting function will turn it into 'MMM-YYYY', but the AddMonths requires its first parameter to be a full date. This could be causing the mismatch. With the assumption that your date field is a full date (like 3/13/2018), can you see if this works?

=

Sum(

{

$<

Datefield={$(='"'&concat(distinct date(Addmonths(Datefield,-(if(getselectedCount(Datefield)=0,1,getselectedCount(Datefield)))) ,'M/D/YYYY'),'","')&'"')}

>

}

Valuefield

)