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: 
tracycrown
Creator III
Creator III

Dual(SubField(Class()))

Dear all

Merry Christmas and Happy New Year to all of you.

I need help urgently on how to equal interval in Sales $'M with decimal point using Dual(SubField(Class())) function.

The answer I would like to see is as follows :

YearSales $'MNo. of CompanyMinAvgMax
20120 - 0.91$167,823$167,823$167,823
20121.0 - 9.94$1,186,050$2,901,818$3,706,467

 

Thank you so much, Tracy

 

6 Replies
Anil_Babu_Samineni

Why you are choosing Subfield(), Subfield never recommend in tabular until unless you have strong needs.  Cant you add like

=If([Sales $'M]>=0 and [Sales $'M]<=0.9, '0-0.9', If([Sales $'M]>0.9 and [Sales $'M]>9.9, '1.0-9.9'))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tracycrown
Creator III
Creator III
Author

Dear Mr Anil_Babu_Samineni

Thank you for your help.

Please advise what if I would like QV to auto generate the grouping with equal interval as follows :

0 - 0.9

1 - 1.9

2 - 2.9

3 - 3.9

Thank you, Tracy

Anil_Babu_Samineni

This will work normally

Class([Sales $'M], 0.9)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tracycrown
Creator III
Creator III
Author

Dear Mr Anil_Babu_Samineni

Can you advise where to insert Class([Sales $'M],0.9) in the script or dimension?. Also, can you help to insert it in the attached Test-1.qvw?.

Thank you, Tracy

 

 

 

Anil_Babu_Samineni

Do you have data with respect to point decimals? If so data will come, As i can see If i add the same as dimension the data is coming weird. Don't know what you are referring here for these

0 - 0.9

1 - 1.9

2 - 2.9

3 - 3.9

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tracycrown
Creator III
Creator III
Author

Dear Mr Anil_Babu_Samineni

Can you advise how to group Sales $'M automatically in the above format 0-0.9, 1-1.9 etc ?. Please note that It is perfectly OKay if some grouping (2-2.9) does not have data for Year 2012. :

0-0.9       1 - Company B

1-1.9       1 - Company A

 2-2.9      0 - None

3-3.9       3 - Company C, D & E

Thank You, Tracy