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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Hariprasath2394
Partner - Contributor III
Partner - Contributor III

Set Analysis to Show last 30 days is not working

I am trying to show last 30 days of data in QlikView in line chart. But the expression that I have tries is not working. I have the excel file that has the data with Date, Type, Value, and Country.

My dimension is: Date

My expression is:

Sum({$<TypeQC={"External NC"}>+1<CountryQC={"Italy"}>+1
<DateQC = {"$(='>=' & Date(Max(DateQC)-30, 'DD-MMM-YYYY') & '<=' & Date(Max(DateQC), 'DD-MMM-YYYY'))"}>} ValueQC)

I have the values from July to October and I want to show data for past 30 days only from today but my chart is showing values of all dates.

In the below screenshot the expression is showing correctly as >=14-Sep-2020 to <=14-Oct-2020 as maximum date in the excel file is 14-Oct-2020. But I don't understand why the July, August values are populating in the table and chart.

image.png

Below is the screenshot of the excel file. If you look at the September 2  data, there are values 2 in Internal NC and 4 in External NC but in the expression I have given the condition as TypeQC="External NC". But instead in the table it is calculating both internal and external and giving the data as 6. This is one more problem that I am facing.

image.png

Can anyone please help me? @sunny_talwar can you please let me know what mistake I am doing in the expression?

1 Solution

Accepted Solutions
MayilVahanan

Hi @Hariprasath2394 

Try like below

Sum({$<TypeQC={'External NC'},CountryQC={'Italy'},DateQC = {"$(='>=' & Date(Max(DateQC)-30, 'DD-MMM-YYYY') & '<=' & Date(Max(DateQC), 'DD-MMM-YYYY'))"}>} ValueQC)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan

Hi @Hariprasath2394 

Try like below

Sum({$<TypeQC={'External NC'},CountryQC={'Italy'},DateQC = {"$(='>=' & Date(Max(DateQC)-30, 'DD-MMM-YYYY') & '<=' & Date(Max(DateQC), 'DD-MMM-YYYY'))"}>} ValueQC)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Hariprasath2394
Partner - Contributor III
Partner - Contributor III
Author

Hi @MayilVahanan . Thanks a lot for your solution. I tried the expression and it worked as I expected. The mistake that I did was basically using +1 in the expression and using wrong ". 

Thank You,

Hari