28 Replies Latest reply: Nov 27, 2017 10:27 AM by Daniele Caprelli

# Filter distinct Count() for only a condition

Hi i need to filter my Count() only when a condition is verified, in details:

i need to Count, only items where my field ANNO_EMI = ANNO + 1

• ###### Re: Filter distinct Count() for only a condition

Hi Daniele,

may be like this:

Count (Distinct {<ANNO_EMI ={'ANNO + 1'}>} PDR)

Thanks,

Arvind Patil

• ###### Re: Filter distinct Count() for only a condition

I think there are an error becouse if i write like this it not show me nothing but if i write:

Count (Distinct {<ANNO_EMI ={'04'}>} PDR)

it show me the line..... i think the error is in the field ANNO + 1

• ###### Re: Filter distinct Count() for only a condition

May be this

Count(DISTINCT {<ANNO_EMI = {"\$(=Num(ANNO+1, '00'))"}>} PDR)

• ###### Re: Filter distinct Count() for only a condition

No, i think problem is in the Field ANNO, the formula not take it, becouse is i write :

Count(DISTINCT {<MESE_EMISSIONE = {"\$(=Num(2+1, '00'))"}>} PDR)

it take me the value and design the line in the chart

• ###### Re: Filter distinct Count() for only a condition

May be there are multiple values and you need to use Max() or Min() function

Count(DISTINCT {<ANNO_EMI = {"\$(=Num(Max(ANNO)+1, '00'))"}>} PDR)

• ###### Re: Filter distinct Count() for only a condition

Look at the picture, it not show me nothing..... my field MESE_EMISSIONE is in my database with value format 01... 12 and MESE_COMPETENZA with the same format.... if i use that kind of formula with replace MESE_COMPETENZA with  a number value, chart show me values

Count(DISTINCT {<MESE_EMISSIONE = {"\$(=Num(2+1, '00'))"}>} PDR)

• ###### Re: Filter distinct Count() for only a condition

What do you get when you add this to a text box object?

=Num(Max(ANNO)+1, '00')

Do you get 03?

• ###### Re: Filter distinct Count() for only a condition

I get all these values, like you see in the line chart

• ###### Re: Filter distinct Count() for only a condition

I was asking for this expression in a text box object, not a line chart?

• ###### Re: Filter distinct Count() for only a condition

is the same, in the text box the value is: 13

• ###### Re: Filter distinct Count() for only a condition

So you set analysis is actually doing this

Count(DISTINCT {<ANNO_EMI = {"\$(=Num(13, '00'))"}>} PDR)

This is because set analysis is evaluated once per chart. So the value you see in text box object, is the value used in the set analysis for the whole chart. May I know the reason you expect to see 2 + 1?

• ###### Re: Filter distinct Count() for only a condition

but i not want to set 2 + 1 i want to set: MESE_COMPETENZA + 1

but it not start....

• ###### Re: Filter distinct Count() for only a condition

Don't think I understand. Sorry my friend

• ###### Re: Filter distinct Count() for only a condition

my problem i need to put a chart where my value of Budget line is my MESE_EMISSIONE = MESE_COMPETENZA +1

• ###### Re: Filter distinct Count() for only a condition

Oh okay, try this

Above(Count(DISTINCT PDR))

• ###### Re: Filter distinct Count() for only a condition

Or this

Before(Count(DISTINCT PDR))

• ###### Re: Filter distinct Count() for only a condition

but there i not see the filed MESE_EMISSIONE e MESE _COMPETENZA (those are columns in my table)

• ###### Re: Filter distinct Count() for only a condition

thanks but i sent all from the first post.........

• ###### Re: Filter distinct Count() for only a condition

I don't see any qvw sample

• ###### Re: Filter distinct Count() for only a condition

I already sent in first post, but i resend no problem:

this is the sample, you see i not visualize nothing in the chart... i need to display the line that rapresent my COUNT of my PDR that i have in the database for condizion MESE_EMISSIONE = MESE_COMPETENZA + 1

• ###### Re: Filter distinct Count() for only a condition

This is an image... I am sure someone else might be able to help better

Best,

Sunny

• ###### Re: Filter distinct Count() for only a condition

ok i understand the project where i have this layout is really big, i will try to reduce it and make an example and i will post here, thanks

• ###### Re: Filter distinct Count() for only a condition

Hi i upload the example, can you help me with that ?

• ###### Re: Filter distinct Count() for only a condition

try the first option, maybe the problem is that field "ANNO_EMI" not exist.

so, the correct expression is:

=Count (Distinct {<ANNO_EMISSIONE ={'\$(ANNO) + 1'}>} PDR)

I hope it has been helpful.

Regards,

Alvaro Silveira

• ###### Re: Filter distinct Count() for only a condition

no is not that

• ###### Re: Filter distinct Count() for only a condition

possible nobody can't help me? Sunny said me to upload an example and i did it,

is so difficult make a line chart where i can take a COUNT of my item PDR where my MESE_EMISSIONE = MESE_COMPETENZA + 1 ?