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

adding a second condition to expression

Hi,

I've the following condition to calculate the the rolling avg.

sum({<MonthYear ={">=$(=Date(addmonths(Max(MonthYear), -13), 'MMM-YY')) <=$(=Date(addmonths(Max(MonthYear), -1),  'MMM-YY'))"} >} STBEL)

Now I want to add so it only do this calculation if order type equals "2"   ( STOTYP=2 )

I'm not sure where the first calculation starts and stops (new to Qlikview)

Can someone please help me to add this condition to the calculation.

Many Thanks

1 Solution

Accepted Solutions
shawn-qv
Creator
Creator

sum({<MonthYear ={">=$(=Date(addmonths(Max(MonthYear), -13), 'MMM-YY')) <=$(=Date(addmonths(Max(MonthYear), -1),  'MMM-YY'))"}, STOTYP = {2}>} STBEL)


Essentially, you can place it before or after the MonthYear = {} condition.

The QlikView's Help file is a good place to help you understand Set Analysis a little better.


S.

View solution in original post

4 Replies
eduardo_sommer
Partner - Specialist
Partner - Specialist

Before the last angle bracket (>), include ,STOTYP={2}

This will add the second condition. Don't forget the comma to separate the conditions.

Eduardo

shawn-qv
Creator
Creator

sum({<MonthYear ={">=$(=Date(addmonths(Max(MonthYear), -13), 'MMM-YY')) <=$(=Date(addmonths(Max(MonthYear), -1),  'MMM-YY'))"}, STOTYP = {2}>} STBEL)


Essentially, you can place it before or after the MonthYear = {} condition.

The QlikView's Help file is a good place to help you understand Set Analysis a little better.


S.

Not applicable
Author

Can't you simply add

<STOTYP={2} at the start of the set analysis

Not applicable
Author

Thanks Shawn