Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sekharQV
Creator
Creator

Filtering Pivot Table Data

Hi,

I have below urgent requirements, Please help me.

Requirement1

TRevenueTMarginTMargin%
32,3931752954%
23,14512,25847%
22,7358,17536%
Some DataSome Data37%
Some DataSome Data36%
Some DataSome Data54%
Some DataSome Data100%
Some DataSome Data45%

Here i want to add two filters using multiboxes TMargin%<  and TMargin%>

-->Drop down values in T Margin % < filters should be 5, 10, 15, 20, 25.

-->Drop down values in T Margin % > filters should be 75, 80, 85, 90, 95.

-->Also there should be an option to view all values in the report. That is not applying any of the above two filters




Requirement2:


I have a table like below


Contarct NoGLDate
11120160831
11220160808
11320160804
11420160808
11520160809
11620160605
11720160409


I want to adda a filter using multibox on ‘GLDate’. The drop down values should be > 2Weeks, > 1 Month and > 2 Months. GL Date should be compared with today’s date to identify whether it is > 2 weeks or > 1 month etc.

Can anybody help me regarding these requirements.

Thanks,

Rajasekhar

1 Solution

Accepted Solutions
Not applicable

I had to do some tweaking of the expression in the chart table, but looks like it is working fine.

Please check out the attached qvw and let me know if this is correct.

- Stan

View solution in original post

23 Replies
agomes1971
Specialist II
Specialist II

Hi,

please see attached for requirement 1

HTH

André Gomes

agomes1971
Specialist II
Specialist II

Hi,

please see attached for requirement 2

HTH

André Gomes

Not applicable

For Requirement 1, please see the attached Multiboxes.qvw

The key pieces are as follows:

1. Two inline tables for the valid % selections (i.e. 5%, 10%, etc...)

LowMargins:
load * inline [
Low Margin%
0
5
10
15
20
25
]
;

HighMargins:
load * inline [
High Margin%
75
80
85
90
95
100
]
;

2. Two variables to capture the Multibox selections and to handle if nothing selected:

vSelectedLowMargin = If(isnull(GetFieldSelections([Low Margin%])),0,GetFieldSelections([Low Margin%]))

vSelectedHighMargin = If(isnull(GetFieldSelections([High Margin%])),100,GetFieldSelections([High Margin%]))

In the Chart or Table enter the following expression in place of the Margin% field:

=(Aggr(Margin,Customer,Product,Month) >= vSelectedLowMargin and Aggr(Margin,Customer,Product,Month) <= vSelectedHighMargin) * -1 * Margin

In the expression above the two Aggr functions inside the parentheses will either return a 0 for false or a -1 for true. If the result is false then 0 * Margin will be zero and not included in the chart. If the result is true then Margin will be multiplied * -1 so the Margin will be included in the chart. The extra -1 is so the Margin% is not negative.

For Requirement 2, you should be able to use the same technique to get what you need.

Hope this helps!

- Stan

sekharQV
Creator
Creator
Author

Hi,

Thanks for reply. But when i am trying to add 5% also in TMargin%< list box, it is not showing. Can you halp regarding this?

Thanyou,

Rajasekhar

agomes1971
Specialist II
Specialist II

Hi,

please see attached.

HTH

André Gomes

sekharQV
Creator
Creator
Author

Hi Andre,

Thank you very much for your reply.

Actually i have Inline table table like below.

LOAD * INLINE [

    GLFilter

    > 2 Weeks

    > 1 Month

    > 2 Months

];

So i want to create a filter on GLDate using above field(GLFilter) in multibox.

Could please guide me?

Thanks,

Rajasekhar

sekharQV
Creator
Creator
Author

Hi Andre,

Thank you very much for your reply.

Actually i have Inline table table like below.

LOAD * INLINE [

    GLFilter

    > 2 Weeks

    > 1 Month

    > 2 Months

];

So i want to create a filter on GLDate using above field(GLFilter) in multibox.

Could please guide me?

Thanks,

Rajasekhar

agomes1971
Specialist II
Specialist II

Hi,

then you have to change your data model.

Your way will not work if you don't change the data Model.

Regards

André Gomes

Not applicable

Hi,

I believe the attached qvw will give you what you are asking for, but please let me know!

Thanks!

- Stan