Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

vardhan1305
New Contributor II

Display Last value.

Hi Experts.

I have a pivot table

ID        Customer          Hours            Bonus                Salary

1          a                        20                    100                  2000

1          a                          20                    500              10000

1          b                        30                    100                3000

1          b                        50                    60                    3000

1          b                        60                  30                    1800

1            c                          50                  100               5000

1            d                        20                  50                    1000

The Salary field  is given in the expression as Hours*Bounus (Column(1)* Column(2))

Now i do have another Pivot table where the Output needs to be displayed as

ID        customer          a          b                c                    d

1                              10000      1800        5000            1000



It should display the last value of each customer.


How should i do it in front end.



Please help me out.

2 Replies
jyothish8807
Honored Contributor II

Re: Display Last value.

Try like this:

Load

ID,

Customer,

Hours,

Bonus,

Salary,

Rowno() as Sino

from <>


The in UI create a pivot table.


Dimension;

1. ID

2. Customer --> Drag and birng on top


expression:


firstsortedvalue(Salary,-Sino)


Br,

KC

Best Regards,
KC
shiveshsingh
Honored Contributor

Re: Display Last value.

Hi

Please refer below

T:LOAD * INLINE [

    ID,Customer,Hours,Bonus   

    1,a,20,100    

    1,a,20,500   

    1,b,30,100   

    1,b,50,60   

    1,b,60,30   

    1,c,50,100   

    1,d,20,50

];

F:

load *, Hours*Bonus as Salary,RowNo() as Flag

Resident T;

drop Table T;

Dimension - ID, Customer

Expression - FirstSortedValue((Salary),-Flag)

Capture.PNG