Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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)

Highlighted

May be Set Analysis expression like this:

Sum({$<Date=

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

>}Value)

Highlighted
Partner
Partner

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

)