Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
shwetagupta
Not applicable

Wrong Result on using search/filter on table

Hi All,

I am facing an interesting problem. I have created a straight table where measures are LLYTD, LYTD, YTD

Values are coming out correct as per the database.

But things went wrong when I search dimension on the table. Value changes !!!

I cant post the qvf but can anyone suggest what can be reason so that I can look into that particular area.

Attached screenshot will explain my question  more better.

Please suggest !!!

1 Solution

Accepted Solutions
kaushik_solanki
Not applicable

Re: Wrong Result on using search/filter on table

Hi,

It is because the Max Date is getting changed as per the Selection.

What you can do is  add {1} in Max as shown below.

Sum({<Date1="$(='>='&Date(YearStart(max({1}Date1),-2,4),'DD/MM/YYYY')&'<='&Date(Addyears(max({1}Date1),-2),'DD/MM/YYYY'))"}>}NetSales)

Regards,

Kaushik Solanki

5 Replies
rittermd
Not applicable

Re: Wrong Result on using search/filter on table

Can you post the actual measures that you are using to get the totals?

shwetagupta
Not applicable

Re: Wrong Result on using search/filter on table

1LLYTD: Sum({<Date1="$(='>='&Date(YearStart(max(Date1),-2,4),'DD/MM/YYYY')&'<='&Date(Addyears(max(Date1),-2),'DD/MM/YYYY'))"}>}NetSales)

1LYTD:

Sum({<Date1="$(='>='&Date(YearStart(max(Date1),-1,4),'DD/MM/YYYY')&'<='&Date(Addyears(max(Date1),-1),'DD/MM/YYYY'))"}>}NetSales)

1YTD:

sum({< vYear = {"$(=max(vYear))"}>} NetSales)

Actually my data is coming from two different ERPs, where I have Joined Customer Names of two different ERPs and depicting primary sales and secondary sales.

Any suggestion where should I check to correct this

kaushik_solanki
Not applicable

Re: Wrong Result on using search/filter on table

Hi,

It is because the Max Date is getting changed as per the Selection.

What you can do is  add {1} in Max as shown below.

Sum({<Date1="$(='>='&Date(YearStart(max({1}Date1),-2,4),'DD/MM/YYYY')&'<='&Date(Addyears(max({1}Date1),-2),'DD/MM/YYYY'))"}>}NetSales)

Regards,

Kaushik Solanki

shwetagupta
Not applicable

Re: Wrong Result on using search/filter on table

Hi Kaushik,

This works for me

Thanks a lot.

Please let me know one thing  Max({1}Date1) how impact the selections made.

Little Confused !!

kaushik_solanki
Not applicable

Re: Wrong Result on using search/filter on table

Hi,

It is a Set analysis, So when we define {1} it means that ignore all selection to calculate the function where it is used.

So in your case all the selection will be ignored when Max is calculated.

Hope it is clear.

Regards,

Kaushik Solanki