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: 
soniasweety
Master
Master

New column

Hi All,

Olivier Robin

Anupam Mehta

Pooja Nagaraj

i want to create a new column in Pivot table

REQ: i need one extra column(Total)  the total column show always sum up the  COunt(New)+count(Old)

if user select any measure  for that measure also it should sum count(New)+Count(Old)

Result:

in above example  result column should be:

total

A: 2(New)+old(2)

B:1(New)+0(Old)

C:0(New)+1(Old)

23 Replies
olivierrobin
Specialist III
Specialist III

hello

i don't really understand your need ...

in a pivot table, you can add a new column with an expression

such as sum(New)+sum(Old)

count(distinct new) + count(distinct Old)

Is this your need ?

soniasweety
Master
Master
Author

No no.

here i need a Result column Total

that total how it is caluclating  like below

if i select  any measure you can see  count /sum/avg for  New and old

so  here it should sum  the    count measure new + count meausre old+ count measure of avg

olivierrobin
Specialist III
Specialist III

can you give some sample input data ?

As I understand you have

Key New Old

A      2       2

B      1       0

C      0       1

and the expected result is

A 4

B 1

C 1

?

soniasweety
Master
Master
Author

Hi

Attached updated Qvw

i want to always sum up and show the total column      Net(sum(New)+sum(Old)

soniasweety
Master
Master
Author

yes the result should be above you mentioned   ...if one more measure is selected it should sum the only   net(Measure only)

olivierrobin
Specialist III
Specialist III

you can't select a measure, you select a key ...

As I understand, you could :

create an inline table with values 'New','Old' (let's say the column name is Choice)

so that user can select one or more values in this list

and your new column would be something like

if(wildmatch(concat(Choice),'*New*),sum(New),0) + if(wildmatch(concat(Choice),'*Old*),sum(Old),0)

soniasweety
Master
Master
Author

its an adhoc report

   so user can select the  measures and dimensions

if only user selected   

Dimesnion:company and type

Measure: Net

result:  type New only

result:  350

200

0

olivierrobin
Specialist III
Specialist III

I did'nt notice that

but

as Old, new is a dimension, if you select one value, it works as desired with doing anything

soniasweety
Master
Master
Author

old new is not diemnsion

type is the dimension :   type values are new and old.  

now you cannt get the result directly