Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combine different if statements

I need to make a bar chart of the sales of a particular department and certain type of fruit and that for the previous 12 months by month.

So I want a graph with on the X axis 01-2016 , 02-2016, 03-2016 and for each month the sale of Apples for the new department.

to calculation of the sales for the department and fruit is done by:

=Sum({<Group = {New}, Fruit = {Apple} >} [Sales])

This gives me back the Sales for Apples in the new group

To present the previous 12 months in the graph I use this:

=Sum ({$<K_Period={">=$(=$(vPeriodStartYear))<=$(=Max(K_Period))"},K_Year=,K_Month=>}Sales)

This gives me all sales of all fruits and

So I want to combine both statements but everything i tried so far failed.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

=Sum ({$<Group = {New}, Fruit = {Apple}, K_Period={">=$(=$(vPeriodStartYear))<=$(=Max(K_Period))"},K_Year=,K_Month=>}Sales)


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Not applicable
Author

I found the answer by myself allready

=Sum ({$<K_Period={">=$(=$(vPeriodStartYear))<=$(=Max(K_Period))"},K_Year=,K_Month=,[Group="New"], [Fruit=[Apple]>}Sales)

Gysbert_Wassenaar

=Sum ({$<Group = {New}, Fruit = {Apple}, K_Period={">=$(=$(vPeriodStartYear))<=$(=Max(K_Period))"},K_Year=,K_Month=>}Sales)


talk is cheap, supply exceeds demand
Gysbert_Wassenaar

I'd check the result of that expression if I were you. [Group="New"] and [Fruit=[Apple] are not valid syntax. I'd be surprised if an expression containing that would return a result at all/.


talk is cheap, supply exceeds demand
Anil_Babu_Samineni

Is that is work for you? I don't think so

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable
Author

I used this one

Sum ({$<K_Periode={">=$(=$(vPeriodeStartYear))<=$(=Max(K_Periode))"},K_Year=,K_Month=,[Group]={"New"}, [Fruit]={"Apple"} >}_aantal_calls)

Not applicable
Author

It works

Gysbert_Wassenaar

That looks a lot better


talk is cheap, supply exceeds demand