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: 
safik003
Contributor III
Contributor III

How to select multiple field values based on a single selection from the same field in Pivot table

I have a table which contains the fields "Produt No", "Product Name" , "Sales Date", "Warranty Period". I have created a pivot table with all the fields. A file is uploaded for details. These are my data:

Sales:

LOAD * INLINE [
Produt No, Product Name, Sales Date, Warranty Period
1, Apple Phone, 2/1/2018, 1 yr
2, Apple iPad, 5/12/2017, 1 yr
3, Apple Laptop, 6/7/2018, 2 yr
4, HP Laptop, 6/10/2016, 1 yr
5, Samsung Phone, 7/2/2017, 1 yr
6, Samsung TV, 5/4/2018, 2 yr
7, Samsung Laptop, 3/1/2017, 3 yr
8, Lenovo Lap, 1/2/2016, 1 yr
9, Lenovo Phone, 5/6/2018, 3 yr
10, Nokia, 5/5/2017, 2 yr
];

Data are shown in Pivot table looks like below. I have a filter "Product No", my question is if a user wants to select a value  from Product No, three values(Previous value, Selected Value, Next Value) will be shown in the pivot table say if the user select value "4" from Product No, data for Product No 3,4 and 5 will be shown in the pivot table like below:

                            

Produt No                   3                                  4                             5

Product Name           Apple Laptop        HP Laptop          Samsung Phone

Sales Date                   6/7/2018                  6/10/2016           7/2/2017

Warranty Period        2 yr                            1 yr                        1 yr

 

Is there any way to do it? Need help urgently. Thanks a lot in advance.

Labels (1)
26 Replies
safik003
Contributor III
Contributor III
Author

Thanks. I think I'm getting the expected result now.
Thanks for your help.
sunny_talwar

Is it working or do you still need me to look at the other thread that you have created?
safik003
Contributor III
Contributor III
Author

the 'color feature' is working fine, I guess. The new thread is created for another feature. It'd be great help if you look into that. I have sent a text too separately. Thanks
safik003
Contributor III
Contributor III
Author

Hi,

Can you please make some changes in your color expression so that it's highlight the value of "Product Name" when "Product No" changes from lower to higher( in descending order). I'm attaching a file where "Product No" is shown in descending order accordingly "Product Name" is showing . When Product No is changing from 6 to 7, Product Name is changing from Apple Phone to Samsung Phone. Using your expression in dimension background color, it's highlighting the Apple Phone but I want to highlight Samsung Phone(Similarly whenever there is value change(for Product Name) from low Product No to high Product No, I want to highlight the changed value for higher Product No.

Find the attached file for reference.Thanks

@sunny_talwar

sunny_talwar

You will sort your data in the descending order of the Produt No? Try this

for Background Color

=If(Only({<[Produt No] = {"$(=Max([Produt No]))", "$(=Max([Produt No])-1)", "$(=Max([Produt No])+1)"}>}[Product Name])
<>
After(TOTAL Only({<[Produt No] = {"$(=Max([Produt No]))", "$(=Max([Produt No])-1)", "$(=Max([Produt No])+1)"}>}[Product Name]))
and ColumnNo(TOTAL) <> NoOfColumns(TOTAL), Green())

for Text Color

=If(Only({<[Produt No] = {"$(=Max([Produt No]))", "$(=Max([Produt No])-1)", "$(=Max([Produt No])+1)"}>}[Product Name])
<>
After(TOTAL Only({<[Produt No] = {"$(=Max([Produt No]))", "$(=Max([Produt No])-1)", "$(=Max([Produt No])+1)"}>}[Product Name]))
and ColumnNo(TOTAL) <> NoOfColumns(TOTAL), White())
safik003
Contributor III
Contributor III
Author

Thanks @sunny_talwar.Its a great help. Cheers! 🙂
safik003
Contributor III
Contributor III
Author

.