Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Columns in Pivot Table

Hi,

I have a Pivot Table. I need to show an hide few specific columns in the Pivot Table. How do I achieve this?

Here, under 2017, I need to show Sum(Value) and Sum(Sample) columns while under 2018, I need to show only Sum(Value) but not Sum(Sample). The entire column should be hidden, no nulls or '-'

Please refer to the sample data QVW file for better understanding. Really appreciate your help guys.

1 Solution

Accepted Solutions
sunny_talwar

Something like this?

Capture.PNG

Script changes

Input:

LOAD * INLINE [

    Year, Value, Sample

    2018, 2, 6

    2018, 4, 4

    2018, 6, 9

    2017, 3, 3

    2018, 4, 2

    2017, 1, 5

    2017, 3, 4

    2018, 2, 1

    2017, 8, 0

];


Dim:

LOAD * INLINE [

    Dim

    1

    2

];

Dimensions

Year

=Pick(Dim, 'Value', 'Sample')

Expression

Pick(Dim, Sum(Value), If(Year = 2017, Sum(Sample)))

View solution in original post

6 Replies
Anil_Babu_Samineni

You added wrong file? Can you re attach for us

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
qlikwiz123
Creator III
Creator III
Author

My bad. Corrected

qlikwiz123
Creator III
Creator III
Author

Any help is really great in this issue

qlikwiz123
Creator III
Creator III
Author

stalwar1‌ Any insight?

sunny_talwar

Something like this?

Capture.PNG

Script changes

Input:

LOAD * INLINE [

    Year, Value, Sample

    2018, 2, 6

    2018, 4, 4

    2018, 6, 9

    2017, 3, 3

    2018, 4, 2

    2017, 1, 5

    2017, 3, 4

    2018, 2, 1

    2017, 8, 0

];


Dim:

LOAD * INLINE [

    Dim

    1

    2

];

Dimensions

Year

=Pick(Dim, 'Value', 'Sample')

Expression

Pick(Dim, Sum(Value), If(Year = 2017, Sum(Sample)))

qlikwiz123
Creator III
Creator III
Author

stalwar1‌     Thank you. You are a Genius