Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Tribhuwan
Contributor
Contributor

Invalid Dimension Error while creating filter

Hello Everyone,

I am trying to create a filter based on the below logic but getting error of Invalid Dimension.

Can anyone please sort this out for me.

Filter logic:

=if(Sum(if((D_MONTH<vMonth and D_YEAR=Year(Now())) or (D_MONTH>=vMonth and D_YEAR=Year(Now())-1), D_AMOUNT_IN_EUR_12MONTHS_Parent))=0,'Prospect')

Here vMonth is variable whose value is  Let vMonth = num(Month(Today()))

Also value of D_Month and D_YEAR is numerical

Labels (5)
1 Solution

Accepted Solutions
kashaboinaraj
Creator
Creator

Table _Name:

load

D_MONTH,

D_YEAR,

if(Sum(if((D_MONTH<vMonth and D_YEAR=Year(Now())) or (D_MONTH>=vMonth and D_YEAR=Year(Now())-1), D_AMOUNT_IN_EUR_12MONTHS_Parent))=0,'Prospect') as IsProspect

resident Main_table

Group By  D_YEAR,D_MONTH;

View solution in original post

2 Replies
KGalloway
Creator II
Creator II

You may consider moving this to the load script and creating this as a field in the table.

For example,

your_table:

load

D_MONTH,

D_YEAR,

if(Sum(if((D_MONTH<vMonth and D_YEAR=Year(Now())) or (D_MONTH>=vMonth and D_YEAR=Year(Now())-1), D_AMOUNT_IN_EUR_12MONTHS_Parent))=0,'Prospect') as IsProspect

resident your_original_table

group by D_MONTH, D_YEAR;

 

This could work depending on your data structure. Could you provide a sample of what the raw data looks like?

kashaboinaraj
Creator
Creator

Table _Name:

load

D_MONTH,

D_YEAR,

if(Sum(if((D_MONTH<vMonth and D_YEAR=Year(Now())) or (D_MONTH>=vMonth and D_YEAR=Year(Now())-1), D_AMOUNT_IN_EUR_12MONTHS_Parent))=0,'Prospect') as IsProspect

resident Main_table

Group By  D_YEAR,D_MONTH;