Qlik Community

Ask a Question

QlikView Administration

Discussion Board for collaboration on QlikView Management.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
Not applicable
Author

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

View solution in original post

8 Replies
Henric_Cronström

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

Not applicable
Author

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

Not applicable
Author

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

Not applicable
Author

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','.',' ')

Not applicable
Author

Hi , try this


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


Here Vtoday Variable contains =day(Today)


Hope it helps

Not applicable
Author

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

View solution in original post

Not applicable
Author

thank you veryyyy much mr aunez you really made my day

Not applicable
Author

You are wellcome

Fabrice