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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use Set Analysis in above case

Hi,

How to do this example ?

Thank you !

17 Replies
Not applicable
Author

Add the date as a dimension in the chart and create a variable to get tomorrow's date ('vTormorrow' in the example expression) and use the following expression:

=SUM(PM) + SUM({<[date]={"=$(=Date($(vTomorrow)))"}>}AM)

Cheers,

Haneesh

Not applicable
Author

Thank haneesh!

I use :

=count({$ < [Heure De Retrait] ={'>= 13'} >} [No Commande]) + count({<[Heure De Retrait] ={'<= 12'}, [Date Retrait]={$(= date([Date Retrait]+1, 'DD/MM/YYYY'))}>}[No Commande])

You see an error ?!

Not applicable
Author

In your set analysis expression you are doing the date manipulation directly and this could cause issues at times. so, try creating a variable as follows,

vTomorrow = date([Date Retrait]+1)

and use this variable in the set analysis as follows,

=count({$ < [Heure De Retrait] ={'>= 13'} >} [No Commande]) + count({<[Heure De Retrait] ={'<= 12'}, [Date Retrait]={"=$(=Date($(vTomorrow)))"}>}[No Commande])

Not applicable
Author

I used vTomorrow

but this part " count({<[Heure De Retrait] ={'<= 12'}, [Date Retrait]={"=$(=Date($(vTomorrow)))"}>}[No Commande]) "

is always =0

Not applicable
Author

what is the expression used to define 'vTomorrow'?

Not applicable
Author

Try changing

[Date Retrait]={"=$(=Date($(vTomorrow)))"}

to

[Date Retrait]={"$(=Date([Date Retrait] + 1))"}

I have run into wierd problems using a date variable in a set analysis expression before, because QV evaluated the date as a division - e.g. 28/12/11 was being interpreted as 28 divided by 12 divided by 11. This might be happening to you too.

Not applicable
Author

vTomorrow = date([Date Retrait]+1)

Not applicable
Author

Thank for the reply.

I tried to change

[Date Retrait]={"=$(=Date($(vTomorrow)))"}

to

[Date Retrait]={"$(=Date([Date Retrait] + 1))"}

but it's always = 0

Not applicable
Author

I used :

count({<[Date Retrait]={"=$(=Date($(vTomorrow)))"}>}[No Commande]) : Not OK

count({<[Date Retrait]={$(=Date($(vTomorrow)))}>}[No Commande]) : Not OK

count({<[Date Retrait]={"$(=Date([Date Retrait] + 1))"}>}[No Commande]) : Not OK

count({<[Date Retrait]={$(=Date([Date Retrait]+1))}>}[No Commande]) : Not OK

count({<[Date Retrait]={"29/12/2011"}>}[No Commande]) : OK