Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

How to write a greater than expression

Hello All,

         

            I need to write a expression to display only those prices where count of distinct prices are greater than 1 for a materials and plants combination


so i wrote this expression


Aggr(If(Count({<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>} DISTINCT PRICE_MAT) > 1, sum({<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>}DISTINCT PRICE_MAT)),[MATERIAL CODE],[PLANT CODE])


so what i got is this()

Capture1.PNG

The Above expression is picking only one supplier even though it is having 6 distinct supplier ,so what should i need to change in my expression to get display all the supplier for that material plant combination

Capture.PNG

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Or this

Aggr(If(Count(TOTAL <[MATERIAL CODE], [PLANT CODE]> {<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>} DISTINCT PRICE_MAT) > 1, Sum({<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>}DISTINCT PRICE_MAT)),[MATERIAL CODE],[PLANT CODE], Supplier)

View solution in original post

2 Replies
sunny_talwar

May be add Supplier to your Aggr() function

Aggr(If(Count({<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>} DISTINCT PRICE_MAT) > 1, sum({<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>}DISTINCT PRICE_MAT)),[MATERIAL CODE],[PLANT CODE], Supplier)

sunny_talwar

Or this

Aggr(If(Count(TOTAL <[MATERIAL CODE], [PLANT CODE]> {<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>} DISTINCT PRICE_MAT) > 1, Sum({<SCOPE={'Yes'}, VALIDTO ={">$(=Date(today(),'DD-MM-YYYY'))"}>}DISTINCT PRICE_MAT)),[MATERIAL CODE],[PLANT CODE], Supplier)