Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with set analysis

Hi,

I hope somebody can help me.

I've to calculate to total orders (number of received order) at three distinct moments:

today

today - xx days

today - xx * 2 days

For example:

number of orders received today:  100

number of order received today - 2 =  90

number of orders received (today - 2 * 2) = 95

Where xx is a number that the user can set by a slider

I've the following expression:

var_daybefore = 2

= count({<TDATE={"$(=Date(Max(TDATE)- $(var_daybefore) ,'DD/MM/YYYY'))"}>} TORDERS)

The expression above, calculates the number of orders received two days ago and it's correct

I need to calculate the same value , but related to  (2 *  2)  = 4 days ago:

= count({<TDATE={"$(=Date(Max(TDATE)- $(var_daybefore) * 2  ,'DD/MM/YYYY'))"}>} TORDERS)

but it doesn' t work

In short term, the second expression is based on user choise: if the user choose 2 days, I've to compare the values of

today

today - 2

today - 4

Help please !!

Thanks in advance

1 Reply
Gysbert_Wassenaar

The expression looks correct to me. It ought to work. Are you sure the are TORDERS for that date?

Can you could try this?

count({<TDATE={"$(=Date(Max(TDATE) - $(var_daybefore) - $(var_daybefore) ,'DD/MM/YYYY'))"}>} TORDERS)



talk is cheap, supply exceeds demand