Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Pomna
Creator III
Creator III

Filtering Data

I would like to filter my data in the load script or using set expression .  I do not want to use a filter chart. I have a dimension [Customer Satisfaction Rating Date]. I need to load only yesterday's rating using set expression or in the load script . Thanks for your suggestions.

5 Replies
Vegar
MVP
MVP

You can't use set in load scripts, but you can use where clauses when reading your data. Try something like this.

 

LOAD Date, Dimension, Value

FROM source

WHERE Date = today()-1

;

Pomna
Creator III
Creator III
Author

Thanks for the suggestion but its going to limit the data for the whole app but what I wish to do is limit for one chart or sheet in the app.

Vegar
MVP
MVP

Then use a set expression like this. Assuming you are using avg([Customer Satisfaction Rating]) as core calculation. Also assuming that your [Customer Satisfaction Rating Date] is formated as your default date format. 

=avg({<[Customer Satisfaction Rating Date] = {'$(=dayname(today(),-1))'} >}[Customer Satisfaction Rating]) 

Pomna
Creator III
Creator III
Author

Thanks  Vegar but this is a straight table. I do not wish to use aggregation. I just need the table to show only previous days ratings and Monday's rating should show Friday's rating as previous day. Below is how my table looks like. Thanks

Pomna_1-1593471064463.png

 

 

Vegar
MVP
MVP

OK, no aggregation. What about using only()?  It will return null() if you have more than one value in your line combination.

=ONLY({<[Customer Satisfaction Rating Date] = {'$(=dayname(today(),-1))'} >}[Customer Satisfaction Rating]) 

If the suggestion is not meeting your needs  I still might  missunderstand you, then please explain again. Maybe you could provide an inline or csv sample to help us understand your issue?