Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
sunil1989
Contributor
Contributor

Total In Straight table

Hi ,

Thanks in advance,

My requirement is suppose i have 10 location in straight table , but i have to show only one location with there expression ,

but subtotal should have sum of all 10 rows.

bellow All Locations is my Subtotal row.

Summary#Ordered#Short#Sub#All%Short%Sub%All% Avail
All Locations40761771263034.34%3.09%7.43%98.30%
132 Delhi4682718455.77%3.85%9.62%99.20%

Thanks,

Sunilkumar

7 Replies
sunny_talwar

May be use Dimensionality() function

If(Dimensionality() = 0, Sum(Measure), Sum({<Location = {'132 Delhi'}>} Measure)

vicobi123
Contributor III
Contributor III

Is this for QlikView or Qliksense. In Qliksense, the straight table gives you the option to add "Total"

plat.PNG

Regards,

Vic

sunil1989
Contributor
Contributor
Author

It's for qlikview.

sunny_talwar

Did you try my suggestion?

johnw
Champion III
Champion III

Possible data model solution.

LocationGroups:
LOAD 'All Locations' as LocationGroup
,text(fieldvalue('Location',recno())) as Location
AUTOGENERATE fieldvaluecount('Location')
;
CONCATENATE LocationGroups
LOAD * INLINE [
LocationGroup,Location
132 Delhi,132 Delhi
];

Use LocationGroup as your dimension instead of Location, no totals in the chart, no change to your expressions.

Sunny's solution is probably more in line with what you want. Just tossing out another possibility.

sunil1989
Contributor
Contributor
Author

I tried but its not working , thanks.

sunny_talwar

1st of all, I apologize, I missed a parenthesis in my first expression. Not sure if that was the reason behind it not working. I have created a small example for you to see....

Table:

LOAD * Inline [

Location, #Ordered

Loc1, 40

Loc2, 50

Loc3, 60

Loc4, 468

];

Here I would like to see Total row and Loc4 row.

Dimension

Location

Expression

If(Dimensionality() = 0, Sum(#Ordered), Sum({<Location = {'Loc4'}>} #Ordered))

Capture.PNG

I am attaching the qvw sample for you to take a look at