QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Valued Contributor II

Expression help

Hi All,

Below is the sample data set, I want to create a straight table as shown in output.

Requirement: the country name which made the max sale for every year.

 Country sales Year a 100 2010 b 200 2010 c 300 2010 d 400 2010 a 800 2011 b 600 2011 c 700 2011 d 500 2011 a 100 2010 b 200 2010 c 300 2010 d 400 2010 a 800 2011 b 600 2011 c 700 2011 d 500 2011

output:

 year country sales 2010 d 800 2011 a 1600

Regards,

Sundar

Tags (2)
1 Solution

Accepted Solutions
Highlighted
Honored Contributor III

Check this app

11 Replies
Highlighted
MVP

Re: Expression help

It is very straight forward:

1. Create a Straight Table

DONE ...

Highlighted
Valued Contributor II

Re: Expression help

Regards,

Sundar

Highlighted
Honored Contributor III

Re: Expression help

Check this app

Dim: Year, Country

Expr: If(Sum(sales)=Max( TOTAL<Year> Aggr(Sum(sales),Country,Year)),Sum(sales))

Highlighted
Valued Contributor II

Re: Expression help

Thank you,

this is working as expected, but y is this not working in a pivot table?

Regards,

Sundar

Highlighted
Honored Contributor III

Re: Expression help

Set this property, then pivot will display data

Chart Properties --> Presentation --> Check "Always fully expanded"

Highlighted
Employee

Re: Expression help

Why do you want to move it to a pivot table? Your initial questions seems very well suited for a straight table presentation.

Please attach an example of what your pivot table looks like, so we can understand how you have done the pivot table.

Highlighted
Valued Contributor II

Re: Expression help

Hi Toni,

The sample that I have posted above has just 2 dimensions, but in actual scenario there are three, I was hoping that i can replicate the result for three dimensions once i get an idea here

If(Sum(sales)=Max( TOTAL<dim1,dim2> Aggr(Sum(sales),dim1,dim2,dim3)),Sum(sales))

I was trying to get one dimension horizontal and another vertical so wanted to switch over to Pivot.

Please find attached the sampe excel with the expected output.

Regards,

sundar

Highlighted
Valued Contributor II

Re: Expression help

Anbu,

Thanks for the reply, Attached the sample data and output required. Sorry for the trouble i thought i will be able to replicate the sample to my scenario

Thanks again

Regards,

Sundar

Highlighted
Honored Contributor III

Check this app