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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Expression help

Hi,

I have the below expression that I would like to make absolute.  For example rather than netting the pos_lots, I would like the absolute sum.  Is this possible?

Sum(If(trade_dt >='$(vYesterday)',pos_lots))

Also I have the below expression and I would like to add to the expression to only show values greater than 0.10.  Is this possible as well?

Count(if (OrderStatus='Cancelled',OrderStatus))/Count(TOTAL <OriginatorUserID> OrderStatus)

Regards,

Daniel

24 Replies
sunny_talwar

One of the date fields or if there are 3 of them available (like in your example) less than which date? max of the three, min of the three?

danielnevitt
Creator
Creator
Author

I require the expression to be less that the date field on that line.  Does that make sense?

ie in the example the expression on the first line should be trade_dt <= 15/04/2016 and the second line should be trade_dt <= 18/04/2016 etc

Regards,

Daniel

sunny_talwar

For row level evaluation, set analysis is probably not going to work, may be you need to add Aggr() function in this case:

Sum(Aggr(If(trade_dt <= Date, fabs(pos_lot)), 'AllYourDimensionsHereSeperatedByComma + DateDimension'))

danielnevitt
Creator
Creator
Author

Thanks for the reply Sunny.

I'm slightly unsure what you mean by 'AllYourDimensionsHereSeperatedByComma + DateDimension'?

Is there a way that the expression works based on whichever dates are selected in the Date column?

Regards,

Daniel

danielnevitt
Creator
Creator
Author

Hi Sunny,

Were you able to look at my question below?

Thanks,

Daniel

Thanks for the reply Sunny.

I'm slightly unsure what you mean by 'AllYourDimensionsHereSeperatedByComma + DateDimension'?

Is there a way that the expression works based on whichever dates are selected in the Date column?

Regards,

Daniel

sunny_talwar

What all dimensions are there in your chart right now?

danielnevitt
Creator
Creator
Author

Hi Sunny,

Dimensions are Date and ProductName.

I would then like to show the sum of pos_lots where the trade_dt is less than or equal to the Date in the row.

Hope that makes sense.

Regards,

Daniel

sunny_talwar

Not sure how the data is structured, but try this:

Sum(Aggr(If(trade_dt <= Date, fabs(pos_lot)), ProductName, Date, trade_dt))

danielnevitt
Creator
Creator
Author

Hi Sunny,

Unfortunately that doesn't work.  I am still getting the same results for each date.

Regards,

Daniel

sunny_talwar

I guess I will have difficult time suggesting anything without looking at it. Would you be able to share a sample?