Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

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
Highlighted
Partner
Partner

Re: Filtering Data

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

;

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Creator II
Creator II

Re: Filtering Data

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.

Highlighted
Partner
Partner

Re: Filtering Data

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]) 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Creator II
Creator II

Re: Filtering Data

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

 

 

Highlighted
Partner
Partner

Re: Filtering Data

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?

Plees ekskuse my Swenglish and or Norweglish spelling misstakes