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 show % values using class function

Hi,

i need  to show  in the class  function the values in % like 10% <=x< 20%.

The formula that I use is:

=class(round(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1), .1)

I got the values like 0.1<=x<0.2 and so on.

Any idea?

Thanks!

Andrea

4 Replies
Not applicable
Author

Hello,

You can use the num() function, with your own number format (here, the %).

num(

class(round(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1), .1)

,'# ##0%')

Regards,

Amand

martin59
Specialist II
Specialist II

Hi,

Amand was on the right way,

But to be sure on your numeric format, I advise you to enter the last parameters (decimal and thousand separators) like this :

num( 
class(round(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)
/
count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1), .1)
,'#,##0.%','.',',')

Hope that helps you,

Martin

Not applicable
Author

Hi,

better but not as I want to have. I got only one value 80%, 70%, etc. not 80%<=x<90%.

Any more idea?

Thanks!

martin59
Specialist II
Specialist II

However,

You have to do this :

floor(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale), .1)

& ' <= x < ' &

ceil(aggr(count({<ID_FactSource={'ARIANNA'}>}distinct ID_FAT_DATA_FILE)

/

count({1<ID_FactSource={'ARIANNA'}>} distinct total ID_FAT_KEY_FILE), ID_FAT_C_Committente_Originale)+0.1, .1) as MyField

Hope that helps you,

Martin