Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Not Getting Output from Expression

Hi Experts,

This is my Expression :


Sum({<[Name]={"'='TATA'"}>}Distinct(Sales))

Expected Output : I am using this one in Chart Expression for getting output - I want data only for Tata(Means i want to filter data in expression only for Tata)

but it is showing data for every company (like Barclay,Reliance and Tata) and not filtering.

Is their any thing wrong in my Expression, i am doing??

Please suggest me right way...

Thanks in Advance.

Regards,

Gaurav Saxena

1 Solution

Accepted Solutions
Not applicable
Author

Hey ,

Thanks for response guys...

Abhinvava it still not working.

your expression is not showing error but still it is showing all records for all names.

Martijn my data source is excel files from local machine so i can not send qvw file.(Because is will not show data)

Expression :Sum({<Name={TATA}>} DISTINCT(Sales)) is not filtering data for Tata.

Is their any other thing that i have to do and missing ?

Thanks

View solution in original post

8 Replies
Not applicable
Author

Hi, try this:

Sum({< Name={'TATA'} >}Sales)

ps, you don't need [ ] if your field does not contain any spaces, improved readability

Not applicable
Author

Hi Martijn Biesbroek ,

Thanks for reply.

the expression you are saying is showing error. if i am tring to correct it then it is correct after modifying upto :

Sum({<[Name]={"='TATA'"}>}DISTINCT(Sales))

So how else how can we modify so it will filter data only for Tata.

Seeking for your response.

Thanks

Gaurav Saxena

Not applicable
Author

Hi Gaurav,

Use the following expression.

Hope it helps.

Sum({<Name={TATA}>} DISTINCT(Sales))

Rgrds,

Abhinava

Not applicable
Author

Hi, Can you post you qvw file?

Normally, name = {'Tata'} should work.

PS: sum distinct sales amounts is not a thing you do normally.... (instead count distinct customerId's would make sense)

Not applicable
Author

I agree with you martin..

perhaps he should lose the distinct clause altogether..

Rgrds,

Abhinava

Not applicable
Author

Hey ,

Thanks for response guys...

Abhinvava it still not working.

your expression is not showing error but still it is showing all records for all names.

Martijn my data source is excel files from local machine so i can not send qvw file.(Because is will not show data)

Expression :Sum({<Name={TATA}>} DISTINCT(Sales)) is not filtering data for Tata.

Is their any other thing that i have to do and missing ?

Thanks

Not applicable
Author

Hi Gaurav,

Plz check ur data model to see if the fields Name and Sales are linked correctly.

Secondly, there is no use of distinct clause for calculating sales.

If you want to have distinct sales use the distinct clause with the key connecting the Tables containing Name and Sales.

If it still doesn't work, there might be a problem with your data model. double check it

Rgrds,

Abhinava

Not applicable
Author

Hey,

Now it's working actually the problem is with it's field name. it is 'NAME' and i was used 'Name'.

Thanks Abhinava

Thanks you very much to all for response.

🙂