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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Class Function with Max Interval?

I am using a class function that shows =class(WORKFLOW_DURATION,30,WORKFLOW_DURATION) .

I want the largest interval to show >120. Rather than 120 - 150, etc... How can I do this?

Thanks,

Cassandra

29 Replies
cbaqir
Specialist II
Specialist II
Author

I don't see two rows of data...

cbaqir
Specialist II
Specialist II
Author

This looks right. Testing it out in other situations now. Thanks again!

sunny_talwar

Forgot to attach the screen shot

Capture.PNG

sunny_talwar

No problem Take your time

rahulsingh12
Contributor III
Contributor III

hi Sunny,

I have something similar

I have to  show po amount across various supplier in date bracket

maxDate-- is the date user selects and Orderentry is the po date

Dual(

          If(num($(vMaxDate))-num(OrderEntryDate) <= 120, Class(num($(vMaxDate))-num(OrderEntryDate), 30, 'Age'), '>120'),          

          If(num($(vMaxDate))-num(OrderEntryDate) <= 120, Class(num($(vMaxDate))-num(OrderEntryDate), 30, num($(vMaxDate))-num(OrderEntryDate)), 150)

)

The above is showing error in calculated dimension

regards,

Rahul

sunny_talwar

Would you be able to share a sample to see the issue?

rahulsingh12
Contributor III
Contributor III

Hi This is the code I am using:

MasterCalendar:

LOAD *,Month(date1) as Months,Year(date1) as Years;

LOAD Date('01/01/2015' +IterNo()-1) as date1

AutoGenerate 1

While Date('01/01/2015' +IterNo()-1) <= Today();

PO:

load *

inline

[

supplier,OrderEntryDate,Amount

A,'12-JUN-16',100

B,'13-JUL-17',200

C,'1-JAN-15',30,

];

//WHEN A USER SELECTS A DATE FROM CALENDAR THE AGE IS CALCULATED BY SUBTRACTING ORDERENTRYDATE AND CALENDAR DATE

//THAT AGE IS PUT IN A BUCKET FOR WHICH I THOUGHT OF USING A CLASS FUNCTION

SUPPLIER 0-30     31-60     61-90     >90

A                  100

B                              200

Something like this

regards

rahulsingh12
Contributor III
Contributor III

Hi This is the code I am using:

MasterCalendar:

LOAD *,Month(date1) as Months,Year(date1) as Years;

LOAD Date('01/01/2015' +IterNo()-1) as date1

AutoGenerate 1

While Date('01/01/2015' +IterNo()-1) <= Today();

PO:

load *

inline

[

supplier,OrderEntryDate,Amount

A,'12-JUN-16',100

B,'13-JUL-17',200

C,'1-JAN-15',30,

];

//WHEN A USER SELECTS A DATE FROM CALENDAR THE AGE IS CALCULATED BY SUBTRACTING ORDERENTRYDATE AND CALENDAR DATE

//THAT AGE IS PUT IN A BUCKET FOR WHICH I THOUGHT OF USING A CLASS FUNCTION

SUPPLIER 0-30     31-60     61-90     >90

A                  100

B                              200

Something like this

regards

rahulsingh12
Contributor III
Contributor III

Hi sunny,

aggr(

if(num($(vMaxDate))-num(OrderEntryDate)<0,num('Days<0'),

if(num($(vMaxDate))-num(OrderEntryDate)>=0 and

(num($(vMaxDate))-num(OrderEntryDate))<=180,

(class(num($(vMaxDate))-num(OrderEntryDate),30,'Age')),

//if(num($(vMaxDate))-num(OrderEntryDate)>180,

num('>180 Days'))),company,Supplier,PurchaseOrder)

here I am getting a bracket as 180-210 days which should not be the case as I am restricting it after 180 days as >180 and nor it is able to sort the value

Karthikeyan
Contributor II
Contributor II

Hi,

In this case, how can I custom color the different ranges in the bar chart? What should be the expression I use while setting the color by expression?

For Example,

If(WORKFLOW_DURATION <= 120, RGB(0,0,0),RGB(246,82,117)) does not evaluate correctly and always executes the false color