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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make a Let variable submit to a condition

Hi,

I have a table like this one:

DATEGROUPPRICE
25/10/2012A14
28/10/2012A15
29/10/2012B18
15/10/2012C21
14/11/2012A17
17/11/2012B14
01/12/2012A11
08/12/2012A15
15/12/2012C13

In the same script (once loaded the table), I need to create three variables which take the average price for Group 'A' for each month. I suppose it should be 'let A_oct=avg(PRICE...' but I do not know how to write the condition. The resulting figures into the variables should be:

A_oct              14.5  
A_nov              17.0  
A_dec              13.0  

How could I write the correct script to do this?

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

You don't need to do it in the script. You can assign it using set analysis in Settings > Variable Overview. To make it easier, I added a Month field to your script.  See attached.

View solution in original post

2 Replies
Not applicable
Author

You don't need to do it in the script. You can assign it using set analysis in Settings > Variable Overview. To make it easier, I added a Month field to your script.  See attached.

Not applicable
Author

Understood. Thank you Rebeca.