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

How to use class function in dimension

Hi,

I have some sales histories by different customer ID and I want to classify their total spending in different intervals in a straight table. This is the result after I filter a particular customer with 11 repeat purchases but what I want is to group all transactions in one single line with total sales in 46K.

SpendingNet salesAURTx CountIPT
46K2,541111.6
1-3,0006K1,41931.3
3,001-6,00022K2,22961.7
6,001-9,0006K3,02912.0
9,001-12,00012K5,85612.0

This is the calculated dimension I am using and I've tried different way, like using Sum([Invoice Net Amount in HKD]) or Aggr() to group invoice amount by customer ID but no luck.

=Dual(num(SubField(Class([Invoice Net Amount in HKD],vSpendingInterval*1000)+1,' ',1),'#,##0')&'-'&num(SubField(Class([Invoice Net Amount in HKD],vSpendingInterval*1000),' ',5),'#,##0'),

  num(SubField(Class([Invoice Net Amount in HKD],vSpendingInterval*1000),' ',1),'#,##0'))

1 Reply
Not applicable
Author

Hi

Please PUT some of your raw data and desired output so that format of your table data and necessary function usage can be understood.