# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

## Apply total of one column to another in straight table

Hi There

I am using straight table. I have to show total generated by column 2 on total generated on column 3.

Please find attached screenshot , is it Possible to perform this?

1 Solution

Accepted Solutions
Esteemed Contributor

## Re: Apply total of one column to another in straight table

in ur first expression; change it from

count(distinct [Line Desc 1])

to:

if(Dimensionality()=0,Count( total Distinct {<AccountDesc>}[Item-Branch Key]), count(distinct [Line Desc 1]))

result:

8 Replies
Valued Contributor

## Re: Apply total of one column to another in straight table

Hi Ashish, very strange requirement . If possible please share the reason for it... just for my general knowledge.

I learned about this possibility yesterday from celambarasan but not sure if it works. please try this on the measure you're using for products, Just replace the aggregation and the right field names:

If(Alt(Rowno(),0)=0, Sum(%Items), Count(Products))

I hope it's helpful

Cheers,

L

Honored Contributor III

## Re: Apply total of one column to another in straight table

try:

if(Dimensionality()= 0,sum(aggr(Sum(% of Items),Account)),Count(Products))

Contributor II

## Re: Apply total of one column to another in straight table

Hi Luis

Thanks for responding , I tried with your expression however its not working.

we have one requirement to show same total for multiple columns . we can do this in excel but not sure ab

MVP

## Re: Apply total of one column to another in straight table

Can you please provide sample file

Esteemed Contributor

## Re: Apply total of one column to another in straight table

in your first column, as an expression

if(dimensionality()=0, sum(total measureOfTheSecondColumn), sum(MeasureOfTheFirstColumn):

Example:

IF(Dimensionality()=0, sum(total [Car sales]), Sum([Car production]))

Contributor II

## Re: Apply total of one column to another in straight table

‌file

Esteemed Contributor

## Re: Apply total of one column to another in straight table

in ur first expression; change it from

count(distinct [Line Desc 1])

to:

if(Dimensionality()=0,Count( total Distinct {<AccountDesc>}[Item-Branch Key]), count(distinct [Line Desc 1]))

result:

Contributor II

## Re: Apply total of one column to another in straight table

Thanks Omar , its working fine..