Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Regarding number of columns in a pivot table

Hello Friends,

I appreciate your time.

I have a pivot table with dimesions contractid, contractname,planid , utility type,formid and expresion is

sum(sales)/trans#

where trans# is :No of lines coming up for that specific combination of contract, plan, utilization type, form Id

So how to get that line number in a pivot table?

Kindly let me know.

Kind regards,

Kiru

1 Solution

Accepted Solutions
Not applicable
Author

no, i don't think it would.

View solution in original post

11 Replies
Not applicable
Author

simply say sum(sales)/count(trans#)

Not applicable
Author

Hello Ramkumar,

I appreciate your time.

actually, there is no trans# field.

But it is the number of lines containing the fields contract, plan, utilization type, form Id.

So I have done the expression as sum(sales)/(count(contractid) * count(contratname) * count(plan) * count(util) * count(foemid))

I hope i am in the right tract 😞

please let me know in case if there are any other solutions

Kiru

Not applicable
Author

Then simply say count(1)

sum(sales)/

count(1)

Anonymous
Not applicable
Author

you may want to create the field in your table and do a sum or a count distinct. can you attach sample data/qvw?

Not applicable
Author

I have attached a sample application and as per the appln the count has to be 4

because there are only 4 combinations of rows

but it is not giving that instead.

Kindly have a look at let me know

Kind regards,

Kiru

Not applicable
Author

Hello Jsara,

Thanks and I appreciate your time.

I have a pivot table with dimesions contractid, contractname,planid , utility type,formid and expresion is

sum(sales)/trans#

where trans# is :No of lines coming up for that specific combination of contract, plan, utilization type, form Id

I have attached the application for your reference,

In this case the expression should be sum(sales)/4

because there are only 4 rows with different combinations.

Kindly let me know if you need any further details.

Thanks,

Kiru

Not applicable
Author

SALESAMOUNT/count(total SALESAMOUNT)

Not applicable
Author

Please find attached.

Not applicable
Author

I sincerely appreciate your time. Just a thing to confirm, will it affect the expression values if I add some more fields inside dimension say

contract, plan, utilization type, form Id, prodia,prodname,cartegoty,norx

and I am going to use the same expression SALESAMOUNT/count(total SALESAMOUNT)



and the count has to be only the combination of contractid, contract name, plan, utilization type, form Id,


Kindly let me know

Kiru