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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
nihhalmca
Specialist II
Specialist II

Last 7 days Revenue

Hi All,

I want to show last 7 days revenue so i have implemented below variables and logic.

vMaxdate = Max(Date);

vLast7days = Max(Date,7);

Logice: count({<year,monthname,day,Date ={">=$(vLast7days)<=$(vMaxDate)"}>} Revenue)

I have filters like year, monthname and day etc. Logic is working as expected by year and monthname however if i select day filter its not showing data as expected.

Note: I understood that logic is working for maxdate (without selections) whenever i select some date it would be maxdate by the time logic not working as expected.

Can you help on this.

Thanks,

Nihhal.

Labels (1)
1 Solution

Accepted Solutions
-SW-
Partner - Creator II
Partner - Creator II

Hi Nihal,

Please find attached solution.

I have changed your variables and expressions.

Let me know if this is what you are looking for.

Thanks,

Shun !

View solution in original post

9 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Change the expression to.

count({<year=,monthname=,day=,Date ={">=$(vLast7days)<=$(vMaxDate)"}>} Revenue)


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
nihhalmca
Specialist II
Specialist II
Author

No change kaushik. 

nihhalmca
Specialist II
Specialist II
Author

I think there is no change between our logics. Just our logic avoid year selection, monthname selection and day selection. If user select together it works. By the time last 7 days field shows wrong data. I hope you understand. 


Thanks,

Nihhal. 



kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Is it possible for you to upload the qvw file which sows your problem.

Regards,,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
nihhalmca
Specialist II
Specialist II
Author

Hi Kaushik - Please find the sample file.

-SW-
Partner - Creator II
Partner - Creator II

Hi Nihal,

Please find attached solution.

I have changed your variables and expressions.

Let me know if this is what you are looking for.

Thanks,

Shun !

nihhalmca
Specialist II
Specialist II
Author

Hi Shun, thanks for your help.

I hope you just added - (minus) to my variable right?

-SW-
Partner - Creator II
Partner - Creator II

Not quite... I changed the format of your variables, you can use the QV default date format (Which is numbers).

I also changed your dimension to vMaxDate, and your expression as well.

nihhalmca
Specialist II
Specialist II
Author

Ok but I removed vMaxDate and added Date as dimension, it works as expected. Thanks.