8 Replies Latest reply: Feb 5, 2014 7:32 AM by Fabrice Aunez

# set modifier problem

Hi every boday,

ive been stuck with this problem for three days and

as you can see in the attached picture i have a graphic table , <nom vendeur> is the dimension and i'm making expressions with the rest of fields ,

the application counts the <ca par jour> correctly but my problem is the number of distinct clients per day and month, it always gives me the distinct total number of clients

here is my expressions

=count( {\$ <"\$(=num(day(today())))"="\$(=num(day([Date CA])))"> }distinct [Nom Client] ) --->distinct number of clients pe day

=count( {\$ <"\$(=num(month(today())))"="\$(=num(month([Date CA])))"> }distinct [Nom Client] ) --->distinct number of clients pe month

for other informations just comment

thanks

• ###### Re: set modifier problem

You cannot have an expression to the left of the equal sign inside the set modifier. I.e. the following does not work:

=count( {\$ <"\$(=num(day(today())))"="\$(=num(day([Date CA])))"> } ...

Instead you should use something like:

=count( {\$ <[Date CA]={"\$(=num(day(today())))"}> } ...

HIC

• ###### Re: set modifier problem

i see the problem right now , but the field [Date CA] is a date  and \$(=num(day([Date CA]))) is calculating the day number ,how can i compare [date ca] and today() ? i tried many versions but it gives me 0 result

• ###### Re: set modifier problem

Zeid,

You must remove the day() function. I assume that "Date CA" is a real date: so you can compare to today() directly. day(Today()) will return the day number within the month: from 1 to 31.

And take care that today() according to the last argument, may return the date the document was opended (not necessarily today)

I have published a document on set analysis: http://community.qlik.com/docs/DOC-4889

The english version: http://community.qlik.com/docs/DOC-4951

Hope this helps

Fabrice

• ###### Re: set modifier problem

Mr aunez,

i already have your document and it helped me a lot ,thank you

but concerning my problem here is some of the expressions i had used

=count( { \$ <[Date CA]={"\$(today())"}> } distinct [Nom Client] )

=count( { \$ <[Date CA]={"\$(now())"}> } distinct [Nom Client] )

but no result

just for informations i already compared dates in if statement and it worked well

=num(((SUM(IF  (Date([Date CA])=Date(Today()), [CA],0)))),'# ##0','.',' ')

• ###### Re: set modifier problem

Zeid,

i would try:

§  =count( { \$ <[Date CA]={"\$(=today())"}> } distinct [Nom Client] )

Check also the date format that can hurt set analysis. Chech that [Date CA] was populated with the same format as the one used with today.

One last thing : set analysis and dates have a difficult relationship

Try with their numeric representaion:

§  =count( { \$ <[Date CA]={"\$(=num(today()) )"}> } distinct [Nom Client] )

Fabrice

• ###### Re: set modifier problem

thank you veryyyy much mr aunez you really made my day

• ###### Re: set modifier problem

You are wellcome

Fabrice

• ###### Re: set modifier problem

Hi , try this

=count({<day(date)={'\$(Vtoday)'}>}distinct [Nom Client])

Here Vtoday Variable contains =day(Today)

Hope it helps