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

class() function does not work

Good Morning,

I am trying to use the class() function in a table.

Unfortunately the output is not as supposed to be:

class(
sum(aggr(sum({<Opportunity_Type={'OPEN'}, kickIN={">=$(vL.FieldSelection_Minus1_PB) <= $(vL.FieldSelection_Plus2_PB)"}>}[Open: Total estimated weekly  revenue])
*
sum({<Opportunity_Type={'OPEN'}, kickIN={">=$(vL.FieldSelection_Minus1_PB) <= $(vL.FieldSelection_Plus2_PB)"}>}[Rate Standard]), Opportunity_ID))
  /
sum({<Rate_Standard_Zero_Flag={'N'},Opportunity_Type={'OPEN'}, kickIN={">=$(vL.FieldSelection_Minus1_PB) <= $(vL.FieldSelection_Plus2_PB)"}>}[Open: Total estimated weekly revenue])
,50
)

Instead of a range like 50 <= x < 100, the output is a single number, rounded by the inverval (in this case 50). E.g. the output of my formula is 1460 and when I do the class function around my formula the output is 1450.

Is my formula to complex for the class function? Is there a workaround?

1 Solution

Accepted Solutions
marcus_sommer

Class() returned a dual-value and if you not used the expression-default within the tab numbers or you wrapped it within a num() function you will get only the numeric value and not the string-representation.

- Marcus

View solution in original post

2 Replies
marcus_sommer

Class() returned a dual-value and if you not used the expression-default within the tab numbers or you wrapped it within a num() function you will get only the numeric value and not the string-representation.

- Marcus

sanjay006
Creator
Creator

=Replace(Aggr(class(
sum(aggr(sum({<Opportunity_Type={'OPEN'}, kickIN={">=$(vL.FieldSelection_Minus1_PB) <= $(vL.FieldSelection_Plus2_PB)"}>}[Open: Total estimated weekly  revenue])
*
sum({<Opportunity_Type={'OPEN'}, kickIN={">=$(vL.FieldSelection_Minus1_PB) <= $(vL.FieldSelection_Plus2_PB)"}>}[Rate Standard]),Opportunity_ID))
  /
sum({<Rate_Standard_Zero_Flag={'N'},Opportunity_Type={'OPEN'}, kickIN={">=$(vL.FieldSelection_Minus1_PB) <= $(vL.FieldSelection_Plus2_PB)"}>}[Open: Total estimated weekly revenue])

),Opportunity_ID), '<= x <', ' - ')